Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java
- Timestamp:
- Jan 16, 2012 7:56:19 AM (4 months ago)
- Location:
- trunk/L2J_DataPack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/L2J_DataPack
- Property svn:mergeinfo changed
/branches/unstable/L2J_DataPack_BETA merged: 8407-8426,8428-8480,8482-8491,8493-8588,8590-8629
- Property svn:mergeinfo changed
-
trunk/L2J_DataPack/dist/game/data/scripts/handlers/actionhandlers/L2StaticObjectInstanceAction.java
r8615 r8630 28 28 public class L2StaticObjectInstanceAction implements IActionHandler 29 29 { 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) 31 32 { 32 if (((L2StaticObjectInstance) target).getType() < 0) 33 final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target; 34 if (staticObject.getType() < 0) 33 35 { 34 _log.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + ((L2StaticObjectInstance) target).getStaticObjectId());36 _log.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + staticObject.getStaticObjectId()); 35 37 } 36 38 37 39 // Check if the L2PcInstance already target the L2NpcInstance 38 if (activeChar.getTarget() != target)40 if (activeChar.getTarget() != staticObject) 39 41 { 40 42 // 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)); 43 45 } 44 46 else if (interact) 45 47 { 46 activeChar.sendPacket(new MyTargetSelected( target.getObjectId(), 0));48 activeChar.sendPacket(new MyTargetSelected(staticObject.getObjectId(), 0)); 47 49 48 50 // 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)) 50 52 { 51 53 // 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); 53 55 } 54 56 else 55 57 { 56 if ( (((L2StaticObjectInstance) target).getType() == 2) && (((L2StaticObjectInstance) target).getStaticObjectId() == 24230101))58 if (staticObject.getType() == 2) 57 59 { 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()); 61 63 62 64 if (content == null) … … 71 73 activeChar.sendPacket(html); 72 74 } 73 else if ( (((L2StaticObjectInstance) target).getType() == 2) && (((L2StaticObjectInstance) target).getStaticObjectId() != 24230101))75 else if (staticObject.getType() == 0) 74 76 { 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()); 93 78 } 94 79 } … … 97 82 } 98 83 84 @Override 99 85 public InstanceType getInstanceType() 100 86 {
Note: See TracChangeset
for help on using the changeset viewer.
