A Project for Chronicle 4 based on L2JServer.


    Spoil message for party

    Share
    avatar
    Karakan

    Posts : 421
    Join date : 2013-10-04

    Spoil message for party

    Post  Karakan on 24th November 2013, 13:33

    Might be usefull for someone ^^

    Code:
    Index: D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Spoil.java
    ===================================================================
    --- D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Spoil.java   (revision 460)
    +++ D:/workspace/Lisvus_GameServer/java/net/sf/l2j/gameserver/handler/skillhandlers/Spoil.java   (working copy)
    @@ -19,14 +19,17 @@
     package net.sf.l2j.gameserver.handler.skillhandlers;
     
     import net.sf.l2j.gameserver.ai.CtrlEvent;
    +import net.sf.l2j.gameserver.clientpackets.Say2;
     import net.sf.l2j.gameserver.handler.ISkillHandler;
     import net.sf.l2j.gameserver.model.L2Character;
     import net.sf.l2j.gameserver.model.L2Object;
    +import net.sf.l2j.gameserver.model.L2Party;
     import net.sf.l2j.gameserver.model.L2Skill;
     import net.sf.l2j.gameserver.model.L2Skill.SkillType;
     import net.sf.l2j.gameserver.model.actor.instance.L2MonsterInstance;
     import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
     import net.sf.l2j.gameserver.serverpackets.SystemMessage;
    +import net.sf.l2j.gameserver.serverpackets.CreatureSay;
     import net.sf.l2j.gameserver.skills.Formulas;
     
     /**
    @@ -75,6 +78,27 @@
                        target.setSpoil(true);
                        target.setIsSpoiledBy(activeChar.getObjectId());
                        activeChar.sendPacket(new SystemMessage(SystemMessage.SPOIL_SUCCESS));
    +               /*
    +                * Begin Modification:
    +                * Send Message to Partymembers when Spoil is sucessfull
    +                *
    +                * */
    +               L2Party playerParty = activeChar.getParty();
    +               CreatureSay cs = new CreatureSay(0, Say2.PARTY,activeChar.getName(), target.getName()+" has been spoiled.");
    +               if (activeChar.isInParty())
    +               {
    +                  for (L2PcInstance player : playerParty.getPartyMembers())
    +                  {
    +                     player.sendPacket(cs);
    +                  }
    +               }
    +               else
    +                  activeChar.sendPacket(cs);
    +               /*
    +                * End modification
    +                *
    +                * */               
    +               
                    }
                    else
                    {
    avatar
    DnR
    Admin
    Admin

    Posts : 1023
    Join date : 2012-12-03

    Re: Spoil message for party

    Post  DnR on 25th December 2013, 16:19

    Very helpful idea. Thanks a lot for your share. Smile

      Current date/time is 24th September 2017, 09:48