player killed player announcement

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

player killed player announcement

Post by sahar »

Hey guys, I'm wondering if someone can help me add the location where the player got killed to this announcement option
for example:

Colisum - player1 killed player2

Any ideas? i looked everywhere and didnt find anything.

thanks for the help
Starter
Posts: 484
Joined: Sat Jan 23, 2010 4:42 pm

Re: player killed player announcement

Post by Starter »

Im not sure if this is a good idea.. Imagine you got a lot of players on and everytime someone kills another guy the location where he died has to be checked.. oO
I have promises to keep and miles to go before I sleep.
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: player killed player announcement

Post by sahar »

trust me i know whats good for my server :P the announcements exists on pack i just want to add the location to it
Starter
Posts: 484
Joined: Sat Jan 23, 2010 4:42 pm

Re: player killed player announcement

Post by Starter »

Maybe:

Code: Select all

Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 4764)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy)@@ -117,7 +117,6 @@ import com.l2jserver.gameserver.model.L2Request; import com.l2jserver.gameserver.model.L2ShortCut; import com.l2jserver.gameserver.model.L2Skill;-import com.l2jserver.gameserver.model.L2Skill.SkillTargetType; import com.l2jserver.gameserver.model.L2SkillLearn; import com.l2jserver.gameserver.model.L2Transformation; import com.l2jserver.gameserver.model.L2UIKeysSettings;@@ -131,6 +130,7 @@ import com.l2jserver.gameserver.model.ShortCuts; import com.l2jserver.gameserver.model.TerritoryWard; import com.l2jserver.gameserver.model.TradeList;+import com.l2jserver.gameserver.model.L2Skill.SkillTargetType; import com.l2jserver.gameserver.model.actor.L2Attackable; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.L2Decoy;@@ -1008,7 +1008,7 @@        // Save responder name for log it    private String _lastPetitionGmName = null;-+       /**     * Create a new L2PcInstance and add it in the characters table of the database.<BR><BR>     *@@ -2098,7 +2098,7 @@    {        return _inventory.getTotalWeight();    }-+       /**     * Return the number of recommandation obtained by the L2PcInstance.<BR><BR>     */@@ -2488,7 +2488,7 @@                sendPacket(SystemMessageId.CANNOT_EQUIP_ITEM_DUE_TO_BAD_CONDITION);        }        refreshExpertisePenalty();-+               broadcastUserInfo();                InventoryUpdate iu = new InventoryUpdate();@@ -2688,7 +2688,7 @@    {        return _fistsWeaponItem;    }-+       /**     * Return the fists weapon of the L2PcInstance Class (used when no weapon is equiped).<BR><BR>     */@@ -3076,8 +3076,8 @@        @Override        public void run()        {-           L2PcInstance.this.setIsParalyzed(false);-           L2PcInstance.this.getAI().setIntention(CtrlIntention.AI_INTENTION_REST);+           setIsParalyzed(false);+           getAI().setIntention(CtrlIntention.AI_INTENTION_REST);        }    }    /**@@ -3088,8 +3088,8 @@        @Override        public void run()        {-           L2PcInstance.this.setIsSitting(false);-           L2PcInstance.this.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);+           setIsSitting(false);+           getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);        }    }    /**@@ -3139,13 +3139,13 @@        _warehouse = null;    }    -   /** -    * Return the PcFreight object of the L2PcInstance.<BR><BR> -    */ -   public PcFreight getFreight() -   { -       return _freight; -   } +   /**+    * Return the PcFreight object of the L2PcInstance.<BR><BR>+    */+   public PcFreight getFreight()+   {+       return _freight;+   }        /**     * Returns true if refund list is not empty@@ -3441,7 +3441,7 @@                if(FortSiegeManager.getInstance().activateCombatFlag(this, item))                {                    Fort fort = FortManager.getInstance().getFort(this);-                   fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.C1_ACQUIRED_THE_FLAG), this.getName());+                   fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.C1_ACQUIRED_THE_FLAG), getName());                }            }            // Territory Ward@@ -3554,7 +3554,7 @@                    if( FortSiegeManager.getInstance().activateCombatFlag(this, item))                    {                        Fort fort = FortManager.getInstance().getFort(this);-                       fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.C1_ACQUIRED_THE_FLAG), this.getName());+                       fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.C1_ACQUIRED_THE_FLAG), getName());                    }                }                // Territory Ward@@ -3631,7 +3631,7 @@                sm.addItemNumber(count);                sendPacket(sm);            }-           else +           else            {                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);                sm.addItemName(item);@@ -3744,7 +3744,7 @@                sm.addItemNumber(count);                sendPacket(sm);            }-           else +           else            {                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);                sm.addItemName(itemId);@@ -3754,7 +3754,7 @@                return true;    }-+       /**     * Transfers item to another ItemContainer and send a Server->Client InventoryUpdate packet to the L2PcInstance.     * @param process : String Identifier of process triggering this action@@ -3866,8 +3866,8 @@                item.setProtected(true);        } else            item.setProtected(true);--       // retail drop protection +       +       // retail drop protection        if (protectItem)            item.getDropProtection().protect(this);        @@ -3942,7 +3942,7 @@        else            item.setProtected(true);        -       // retail drop protection +       // retail drop protection        if (protectItem)            item.getDropProtection().protect(this);        @@ -4019,9 +4019,9 @@                        return null;        }-+               // We cannot put a Weapon with Augmention in WH while casting (Possible Exploit)-       if (item.isAugmented() && (isCastingNow() || this.isCastingSimultaneouslyNow()))+       if (item.isAugmented() && (isCastingNow() || isCastingSimultaneouslyNow()))            return null;                return item;@@ -4318,7 +4318,7 @@            if (game != null && game.isBattleStarted())                game.getZone().broadcastStatusUpdate(this);        }-+               // In duel MP updated only with CP or HP        if (isInDuel()                && (needCpUpdate || needHpUpdate))@@ -4489,7 +4489,7 @@        public void queryGameGuard()    {-       this.getClient().setGameGuardOk(false);+       getClient().setGameGuardOk(false);        this.sendPacket(new GameGuardQuery());        if (Config.GAMEGUARD_ENFORCE)        {@@ -4505,8 +4505,8 @@        @Override        public void run()        {-           L2GameClient client = L2PcInstance.this.getClient();-           if (client != null && !client.isAuthedGG() && L2PcInstance.this.isOnline())+           L2GameClient client = getClient();+           if (client != null && !client.isAuthedGG() && isOnline())            {                GmListTable.broadcastMessageToGMs("Client "+client+" failed to reply GameGuard query and is being kicked!");                _log.info("Client "+client+" failed to reply GameGuard query and is being kicked!");@@ -4821,7 +4821,7 @@        {            if (getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_SELL || getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_SELL + 1 || getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_PACKAGE_SELL)            {-               this.setPrivateStoreType(L2PcInstance.STORE_PRIVATE_NONE);+               setPrivateStoreType(L2PcInstance.STORE_PRIVATE_NONE);            }                        if (getPrivateStoreType() == L2PcInstance.STORE_PRIVATE_NONE)@@ -5347,7 +5347,10 @@                String msg = "";                if (getPvpFlag() == 0)                {-                   msg = Config.ANNOUNCE_PK_MSG.replace("$killer", pk.getName()).replace("$target", getName());+                   if (isInsideZone(L2Character.ZONE_PVP))+                       msg = "$killer has slaughtered $target in an arena".replace("$killer", pk.getName()).replace("$target", getName());+                   else+                       msg = Config.ANNOUNCE_PK_MSG.replace("$killer", pk.getName()).replace("$target", getName());                    if (Config.ANNOUNCE_PK_PVP_NORMAL_MESSAGE)                    {                        SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1);@@ -5370,7 +5373,7 @@                        Announcements.getInstance().announceToAll(msg);                }            }-+                       broadcastStatusUpdate();            // Clear resurrect xp calculation            setExpBeforeDeath(0);@@ -5478,7 +5481,7 @@                if (isPhoenixBlessed())            reviveRequest(this, null, false);-       else if (isAffected(CharEffectList.EFFECT_FLAG_CHARM_OF_COURAGE) && this.isInSiege())+       else if (isAffected(CharEffectList.EFFECT_FLAG_CHARM_OF_COURAGE) && isInSiege())        {            reviveRequest(this, null, false);        }@@ -6668,7 +6671,7 @@        }        else if (isMounted())        {-           if (getMountType() == 2 && this.isInsideZone(L2Character.ZONE_NOLANDING))+           if (getMountType() == 2 && isInsideZone(L2Character.ZONE_NOLANDING))            {                sendPacket(ActionFailed.STATIC_PACKET);                sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NO_DISMOUNT_HERE));@@ -6703,7 +6706,7 @@            setMountObjectID(0);            storePetFood(petId);            // Notify self and others about speed change-           this.broadcastUserInfo();+           broadcastUserInfo();            return true;        }        return false;@@ -7151,7 +7154,7 @@                }                                player.setDeleteTimer(rset.getLong("deletetime"));-+                               player.setTitle(rset.getString("title"));                player.getAppearance().setTitleColor(rset.getInt("title_color"));                player.setAccessLevel(rset.getInt("accesslevel"));@@ -7161,7 +7164,7 @@                currentHp = rset.getDouble("curHp");                currentCp = rset.getDouble("curCp");                currentMp = rset.getDouble("curMp");-                               +                               player._classIndex = 0;                try { player.setBaseClass(rset.getInt("base_class")); }                catch (Exception e) { player.setBaseClass(activeClassId); }@@ -7247,7 +7250,7 @@            // Retrieve from the database all skills of this L2PcInstance and add them to _skills            // Retrieve from the database all items of this L2PcInstance and add them to _inventory            player.getInventory().restore();-           player.getFreight().restore(); +           player.getFreight().restore();            if (!Config.WAREHOUSE_CACHE)                player.getWarehouse();            @@ -8971,7 +8974,7 @@                return false;            }            // And this skill cannot be used in peace zone, not even on NPCs!-           if(this.isInsideZone(L2Character.ZONE_PEACE))+           if(isInsideZone(L2Character.ZONE_PEACE))            {                //Sends a sys msg to client                sendPacket(SystemMessage.getSystemMessage(SystemMessageId.TARGET_IN_PEACEZONE));@@ -9756,7 +9759,7 @@        @Override        public void run()        {-           if (L2PcInstance.this.isOnline())+           if (isOnline())            {                SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.PLAYING_FOR_LONG_TIME);                L2PcInstance.this.sendPacket(msg);@@ -10786,7 +10789,7 @@            if (checkLandingState() && getMountType()==2)                teleToLocation(MapRegionTable.TeleportWhereType.Town);            -           if (this.dismount())  // this should always be true now, since we teleported already+           if (dismount())  // this should always be true now, since we teleported already            {                _taskRentPet.cancel(true);                _taskRentPet = null;@@ -10893,7 +10896,7 @@    {        return _lastAccess;    }-       +       @Override    public void doRevive()    {@@ -11203,7 +11206,7 @@            getStatus().reduceHp(value, attacker, awake, isDOT, skill.isToggle(), skill.getDmgDirectlyToHP());        else            getStatus().reduceHp(value, attacker, awake, isDOT, false, false);-+               // notify the tamed beast of attacks        if (getTrainedBeasts() != null )            for(L2TamedBeastInstance tamedBeast : getTrainedBeasts())@@ -11465,8 +11468,8 @@            _log.log(Level.SEVERE, "deleteMe()", e);        }        -       try-       {+       try+       {            if(Config.ENABLE_BLOCK_CHECKER_EVENT && getBlockCheckerArena() != -1)                HandysBlockCheckerManager.getInstance().onDisconnect(this);        }@@ -11799,16 +11802,16 @@        if (Config.WAREHOUSE_CACHE)            WarehouseCacheManager.getInstance().remCacheTask(this);        -       try -       { -           getFreight().deleteMe(); -       } -       catch (Exception e) -       { -           _log.log(Level.SEVERE, "deleteMe()", e); -       } -+       try+       {+           getFreight().deleteMe();+       }+       catch (Exception e)+       {+           _log.log(Level.SEVERE, "deleteMe()", e);+       }        +               try        {            clearRefund();@@ -12874,7 +12877,7 @@        @Override        public void run()        {-           L2PcInstance.this.clearSouls();+           clearSouls();        }    }    @@ -12914,12 +12917,12 @@    public void calculateDeathPenaltyBuffLevel(L2Character killer)    {        if((getKarma() > 0 || Rnd.get(1,100) <= Config.DEATH_PENALTY_CHANCE)-               && !(killer instanceof L2PcInstance) && !(this.isGM())-               && !(this.getCharmOfLuck() && killer.isRaid())+               && !(killer instanceof L2PcInstance) && !(isGM())+               && !(getCharmOfLuck() && killer.isRaid())                && !isPhoenixBlessed()                && !isLucky()                && !(TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getObjectId()))-               && !(this.isInsideZone(L2Character.ZONE_PVP)||this.isInsideZone(L2Character.ZONE_SIEGE)))+               && !(isInsideZone(L2Character.ZONE_PVP)||isInsideZone(L2Character.ZONE_SIEGE)))                        increaseDeathPenaltyBuffLevel();    }@@ -13604,7 +13607,7 @@        {            try            {-               L2PcInstance.this.dismount();+               dismount();            }            catch (Exception e)            {@@ -13802,7 +13805,7 @@        @Override        public void run()        {-           L2PcInstance.this.clearCharges();+           clearCharges();        }    }    @@ -13939,37 +13942,37 @@        public boolean teleportBookmarkCondition(int type)    {-       if(this.isInCombat())+       if(isInCombat())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_BATTLE));            return false;        }-       else if (this.isInSiege() || this.getSiegeState() != 0)+       else if (isInSiege() || getSiegeState() != 0)        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING));            return false;        }-       else if (this.isInDuel())+       else if (isInDuel())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_DURING_A_DUEL));            return false;        }-       else if (this.isFlying())+       else if (isFlying())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_FLYING));            return false;        }-       else if (this.isInOlympiadMode())+       else if (isInOlympiadMode())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_PARTICIPATING_IN_AN_OLYMPIAD_MATCH));            return false;        }-       else if (this.isParalyzed())+       else if (isParalyzed())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_PARALYZED));            return false;        }-       else if (this.isDead())+       else if (isDead())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_WHILE_YOU_ARE_DEAD));            return false;@@ -13979,7 +13982,7 @@            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));            return false;        }-       else if (this.isInBoat() || this.isInAirShip() || this.isInJail() || this.isInsideZone(ZONE_NOSUMMONFRIEND))+       else if (isInBoat() || isInAirShip() || isInJail() || isInsideZone(ZONE_NOSUMMONFRIEND))        {            if(type == 0)                sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_IN_THIS_AREA));@@ -13987,12 +13990,12 @@                sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));            return false;        }-       else if (this.isInWater())+       else if (isInWater())        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_UNDERWATER));            return false;        }-       else if (type == 1 && (this.isInsideZone(ZONE_SIEGE) || this.isInsideZone(ZONE_CLANHALL) || this.isInsideZone(ZONE_JAIL) || this.isInsideZone(ZONE_CASTLE) || this.isInsideZone(ZONE_NOSUMMONFRIEND) || this.isInsideZone(ZONE_FORT)))+       else if (type == 1 && (isInsideZone(ZONE_SIEGE) || isInsideZone(ZONE_CLANHALL) || isInsideZone(ZONE_JAIL) || isInsideZone(ZONE_CASTLE) || isInsideZone(ZONE_NOSUMMONFRIEND) || isInsideZone(ZONE_FORT)))        {            sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_USE_MY_TELEPORTS_TO_REACH_THIS_AREA));            return false;@@ -14863,7 +14866,7 @@            if (rset.next() && rset.getInt("object_id") > 0)                setPetInvItems(true);            else-               setPetInvItems(false);           +               setPetInvItems(false);            rset.close();            statement.close();        }@@ -14876,12 +14879,12 @@            L2DatabaseFactory.close(con);        }    }-+       public String getAdminConfirmCmd()    {        return _adminConfirmCmd;    }-+       public void setAdminConfirmCmd(String adminConfirmCmd)    {        _adminConfirmCmd = adminConfirmCmd;@@ -14891,12 +14894,12 @@    {        _handysBlockCheckerEventArena = arena;    }-+       public int getBlockCheckerArena()    {        return _handysBlockCheckerEventArena;    }-+       /**     * Load L2PcInstance Recommendations data.<BR><BR>     */@@ -14914,7 +14917,7 @@            if(rset.next())            {                setRecomHave(rset.getInt("rec_have"));-               setRecomLeft(rset.getInt("rec_left"));              +               setRecomLeft(rset.getInt("rec_left"));                _time_left = rset.getLong("time_left");            }            else@@ -14935,7 +14938,7 @@        }        return _time_left;    }-+       /**     * Update L2PcInstance Recommendations data.<BR><BR>     */@@ -14970,7 +14973,7 @@            L2DatabaseFactory.close(con);        }    }-+       public void checkRecoBonusTask()    {        // Load data@@ -15056,7 +15059,7 @@                return 0;    }-       +       public int getRecomBonusType()    {        // Maintain = 1 
The appropriate method for you is ofc doDie() (@@ -5347,7 +5347,10 @@). :mrgreen:
I have promises to keep and miles to go before I sleep.
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: player killed player announcement

Post by sahar »

nah thats not what im looking for, i want excact area :P for example Valley of saints, colisum, dragon valley etc...
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: player killed player announcement

Post by sahar »

anyone ? >.<

ps. i just noticed that when a cursed weapon drops it announce the region, thats what i want, but i dont know how to change it to my needs, any1 can help?
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: player killed player announcement

Post by Zoey76 »

The Zone name for cursed weapons ins handled by client, server only send x,y,z.

You will need a walkaround for this.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
sahar
Posts: 582
Joined: Mon Jun 20, 2011 2:40 pm
Contact:

Re: player killed player announcement

Post by sahar »

I got it done using S1_S2 systemMessage
S1 for the string and s2 for the place
Post Reply