L2JMobius

[Custom Code] Player Special Informations [Add your code and idea]

teris1994 · 1 · 1565

Offline teris1994

  • Elder
  • ****
    • Posts: 141
Hello let do it a game  ;D . I have a part of code below and some steps about where adapt the code.
My first idea is Count Monster Kill on a Player.
But we want to make something bigger , add your idea but with code and exlpain it.

Conditions: The idea is to take information of a player about something don't exist (not allowed pvp,pk,fame,raid points etc.) a special information. You can add and equations like (WinRate = pvpKills/pvpDied , pvpDied -> how many times die player by other player).
 

My Part of Kill Count Monsters

1th Step Found:
Attackable.java

2th Step Found Class:
public boolean doDie(Creature killer)

3th Step found line.
Code: [Select]
EventDispatcher.getInstance().notifyEventAsync(new OnAttackableKill(killer.getActingPlayer(), this, killer.isSummon()), this);

4th   Add the code
Code: [Select]
if(Config.ENABLE_COUNT_KILL_MONSTERS)
{
killer.getActingPlayer().getVariables().set(PlayerVariables.KILL_MONSTERS_COUNT, killer.getActingPlayer().getVariables().getInt(PlayerVariables.KILL_MONSTERS_COUNT,0)+1);
//Debug on game.
killer.sendMessage("Killer: "+killer.getName()+" Kills: "+killer.getActingPlayer().getVariables().getString(PlayerVariables.KILL_MONSTERS_COUNT,""));

}
   
The "Config.ENABLE_COUNT_KILL_MONSTERS" if you like make it , just i give a example for condition you can add levels , premium anything you like.
This code part i used for rank monster killer. I dont know if the best way to make it but this i know and i share with you if you like do it same.

I am not a professional i do it this for we share ideas and right path to code. Thank you :P .