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/L2StaticObjectInstanceAction.java

    r8615 r8630  
    2828public class L2StaticObjectInstanceAction implements IActionHandler 
    2929{ 
    30         public boolean action(L2PcInstance activeChar, L2Object target, boolean interact) 
     30        @Override 
     31        public boolean action(final L2PcInstance activeChar, final L2Object target, final boolean interact) 
    3132        { 
    32                 if (((L2StaticObjectInstance) target).getType() < 0) 
     33                final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target; 
     34                if (staticObject.getType() < 0) 
    3335                { 
    34                         _log.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + ((L2StaticObjectInstance) target).getStaticObjectId()); 
     36                        _log.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + staticObject.getStaticObjectId()); 
    3537                } 
    3638                 
    3739                // Check if the L2PcInstance already target the L2NpcInstance 
    38                 if (activeChar.getTarget() != target) 
     40                if (activeChar.getTarget() != staticObject) 
    3941                { 
    4042                        // Set the target of the L2PcInstance activeChar 
    41                         activeChar.setTarget(target); 
    42                         activeChar.sendPacket(new MyTargetSelected(target.getObjectId(), 0)); 
     43                        activeChar.setTarget(staticObject); 
     44                        activeChar.sendPacket(new MyTargetSelected(staticObject.getObjectId(), 0)); 
    4345                } 
    4446                else if (interact) 
    4547                { 
    46                         activeChar.sendPacket(new MyTargetSelected(target.getObjectId(), 0)); 
     48                        activeChar.sendPacket(new MyTargetSelected(staticObject.getObjectId(), 0)); 
    4749                         
    4850                        // Calculate the distance between the L2PcInstance and the L2NpcInstance 
    49                         if (!activeChar.isInsideRadius(target, L2Npc.INTERACTION_DISTANCE, false, false)) 
     51                        if (!activeChar.isInsideRadius(staticObject, L2Npc.INTERACTION_DISTANCE, false, false)) 
    5052                        { 
    5153                                // Notify the L2PcInstance AI with AI_INTENTION_INTERACT 
    52                                 activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target); 
     54                                activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, staticObject); 
    5355                        } 
    5456                        else 
    5557                        { 
    56                                 if ((((L2StaticObjectInstance) target).getType() == 2) && (((L2StaticObjectInstance) target).getStaticObjectId() == 24230101)) 
     58                                if (staticObject.getType() == 2) 
    5759                                { 
    58                                         String filename = "data/html/signboards/tomb_of_crystalgolem.htm"; 
    59                                         String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); 
    60                                         NpcHtmlMessage html = new NpcHtmlMessage(target.getObjectId()); 
     60                                        final String filename = (staticObject.getStaticObjectId() == 24230101) ? "data/html/signboards/pvp_signboard.htm" : "data/html/signboards/tomb_of_crystalgolem.htm"; 
     61                                        final String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); 
     62                                        final NpcHtmlMessage html = new NpcHtmlMessage(staticObject.getObjectId()); 
    6163                                         
    6264                                        if (content == null) 
     
    7173                                        activeChar.sendPacket(html); 
    7274                                } 
    73                                 else if ((((L2StaticObjectInstance) target).getType() == 2) && (((L2StaticObjectInstance) target).getStaticObjectId() != 24230101)) 
     75                                else if (staticObject.getType() == 0) 
    7476                                { 
    75                                         String filename = "data/html/signboards/pvp_signboard.htm"; 
    76                                         String content = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), filename); 
    77                                         NpcHtmlMessage html = new NpcHtmlMessage(target.getObjectId()); 
    78                                          
    79                                         if (content == null) 
    80                                         { 
    81                                                 html.setHtml("<html><body>Signboard is missing:<br>" + filename + "</body></html>"); 
    82                                         } 
    83                                         else 
    84                                         { 
    85                                                 html.setHtml(content); 
    86                                         } 
    87                                          
    88                                         activeChar.sendPacket(html); 
    89                                 } 
    90                                 else if (((L2StaticObjectInstance) target).getType() == 0) 
    91                                 { 
    92                                         activeChar.sendPacket(((L2StaticObjectInstance) target).getMap()); 
     77                                        activeChar.sendPacket(staticObject.getMap()); 
    9378                                } 
    9479                        } 
     
    9782        } 
    9883         
     84        @Override 
    9985        public InstanceType getInstanceType() 
    10086        { 
Note: See TracChangeset for help on using the changeset viewer.