Jump to content

Recommended Posts

Posted

Hello I am doing a server lineage. I have already almost finished, but I would pvpPoints (abyss points in aion) I have done for player vs. player, but still I wanted to mobs gave but pvpPoints.

 

for now i make new instance for mobs with help other ppl but java is not my strong point. the code is not complete and messed up, contains errors

 

package com.l2jserver.gameserver.model.actor.instance;

import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;

/**
* This class manages special pvpkill rewards mobs.
*/
public class L2PvpMobInstance extends L2MonsterInstance
{
public L2PvpMobInstance(int objectId, L2NpcTemplate template)
{
	super(objectId, template);
	setInstanceType(InstanceType.L2PvpMobInstance);
}

/**
* Manages the doDie event<BR><BR>
*
* @param killer The L2Character that killed this instance.<BR><BR>
*/
@Override
public boolean doDie(L2Character killer)
{
	if (!super.doDie(killer))
		return false;
     
      {
         L2PcInstance player = (L2PcInstance) killer;
          if (killer != null)			    // check if the killer is different of null (to avoid NPE error)			


		if  (killer instanceof L2PcInstance)   		// check if the killer was a player or a summon
			player = (L2PcInstance) killer;
		else if (killer instanceof L2Summon)
			player = ((L2Summon) killer).getOwner();// if killer is a summon, redirect to a L2PcInstance type

		{				
				numberToAdd = (getLevel()-79)*2;// do a custom calcul using mob level
					setPvpPoints(killer.getPvpPoints() + numberToAdd);	// add the custom calcul result to the L2PcInstance total pvp points
			}						
					if   (killer instanceof L2PcInstance);			// if killer is a player
					player = (L2PcInstance) killer;
					// do a custom calcul using mob level
					{											// add the custom calcul result to the L2PcInstance total pvp points

					}
				{
		return true;
		}
	}
}

}

 

//Someone suggested to me how to do it only and add coments

 

but if someone has another solution it also can be

 

_( sorry for the English, text is translated )_

  • 1 month later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...