Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2DoorInstanceAction.java

    r7665 r8630  
    2323import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance; 
    2424import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 
     25import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall; 
    2526import com.l2jserver.gameserver.network.serverpackets.ConfirmDlg; 
    2627import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected; 
     
    3031public class L2DoorInstanceAction implements IActionHandler 
    3132{ 
     33        @Override 
    3234        public boolean action(L2PcInstance activeChar, L2Object target, boolean interact) 
    3335        { 
     
    4244                         
    4345                        StaticObject su; 
     46                        L2DoorInstance door = (L2DoorInstance)target; 
    4447                        // send HP amount if doors are inside castle/fortress zone 
    4548                        // TODO: needed to be added here doors from conquerable clanhalls 
    46                         if ((((L2DoorInstance)target).getCastle() != null 
    47                                         && ((L2DoorInstance)target).getCastle().getCastleId() > 0) 
    48                                         || (((L2DoorInstance)target).getFort() != null 
    49                                                         && ((L2DoorInstance)target).getFort().getFortId() > 0 
    50                                                         && !((L2DoorInstance)target).getIsCommanderDoor())) 
    51                                 su = new StaticObject((L2DoorInstance)target, true); 
     49                        if ((door.getCastle() != null && door.getCastle().getCastleId() > 0) 
     50                                || (door.getFort() != null && door.getFort().getFortId() > 0) 
     51                                || (door.getClanHall() != null && door.getClanHall().isSiegableHall()) 
     52                                && !door.getIsCommanderDoor()) 
     53                                su = new StaticObject(door, true); 
    5254                        else 
    53                                 su = new StaticObject((L2DoorInstance)target, false); 
     55                                su = new StaticObject(door, false); 
    5456                         
    5557                        activeChar.sendPacket(su); 
    5658                         
    5759                        // Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client 
    58                         activeChar.sendPacket(new ValidateLocation((L2Character)target)); 
     60                        activeChar.sendPacket(new ValidateLocation(door)); 
    5961                } 
    6062                else if (interact) 
    6163                { 
     64                        L2DoorInstance door = (L2DoorInstance)target; 
    6265                        //            MyTargetSelected my = new MyTargetSelected(getObjectId(), activeChar.getLevel()); 
    6366                        //            activeChar.sendPacket(my); 
     
    6871                        } 
    6972                        else if (activeChar.getClan() != null 
    70                                         && ((L2DoorInstance)target).getClanHall() != null 
    71                                         && activeChar.getClanId() == ((L2DoorInstance)target).getClanHall().getOwnerId()) 
     73                                        && door.getClanHall() != null 
     74                                        && activeChar.getClanId() == door.getClanHall().getOwnerId()) 
    7275                        { 
    73                                 if (!((L2Character)target).isInsideRadius(activeChar, L2Npc.INTERACTION_DISTANCE, false, false)) 
     76                                if (!door.isInsideRadius(activeChar, L2Npc.INTERACTION_DISTANCE, false, false)) 
    7477                                { 
    7578                                        activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target); 
    7679                                } 
    77                                 else 
     80                                else if(!door.getClanHall().isSiegableHall() || 
     81                                        !((SiegableHall)door.getClanHall()).isInSiege()) 
    7882                                { 
    79                                         activeChar.gatesRequest((L2DoorInstance)target); 
    80                                         if (!((L2DoorInstance)target).getOpen()) 
     83                                        activeChar.gatesRequest(door); 
     84                                        if (!door.getOpen()) 
    8185                                                activeChar.sendPacket(new ConfirmDlg(1140)); 
    8286                                        else 
     
    107111        } 
    108112         
     113        @Override 
    109114        public InstanceType getInstanceType() 
    110115        { 
Note: See TracChangeset for help on using the changeset viewer.