Jump to content
  • 0

[Question]How i can to do this?


'Baggos'

Question

I want a code where when a player gets 20 level ie make him automatically teleport to a another area.

 

I have create this, but nothing.

 

 

if (activeChar.getLevel() == 20)

_activeChar.teleToLocation(-84318,244579,-3730, true);

 

Then what you need to work?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

well,you'll need to find the method in l2pcinstance which is responsible for lvl increase.

 

I'll help you.

 

public void increaseLevel()
{
//
}

 

now put inside,this.

if (getLevel() == 20)
	{
		teleToLocation(-84318,244579,-3730);
	}

Link to comment
Share on other sites

  • 0

 

It's ok like that?

 

L2PcInstance

+	public void increaseLevel()
+	{
+	if (getLevel() == 20)
+		teleToLocation(-84318,244579,-3730);
+	}

Link to comment
Share on other sites

  • 0

 

 

It's ok like that?

 

L2PcInstance

+	public void increaseLevel()
+	{
+	if (getLevel() == 20)
+		teleToLocation(-84318,244579,-3730);
+	}

yep

 

but,be aware.

this method already exist in l2pcinstance and contains few more methods.

don't mess them up

Link to comment
Share on other sites

  • 0

yep

 

but,be aware.

this method already exist in l2pcinstance and contains few more methods.

don't mess them up

Yeah... i have error on public void increaseLevel()

but with public void increaseLevel1() is ok... what i can to do with this?

Link to comment
Share on other sites

  • 0

Yeah... i have error on public void increaseLevel()

but with public void increaseLevel1() is ok... what i can to do with this?

because by making increaselevel you duplicate the one which already exist.

I told you that this method already exist.

 

ctrl + f and insert this into the search 'public void increaseLevel()'

 

after that you 'll see this

public void increaseLevel()
{
	// Set the current HP and MP of the L2Character, Launch/Stop a HP/MP/CP Regeneration Task and send StatusUpdate packet to all other L2PcInstance to inform (exclusive broadcast)
	setCurrentHpMp(getMaxHp(), getMaxMp());
	setCurrentCp(getMaxCp());
}

 

then do it,

public void increaseLevel()
{
	// Set the current HP and MP of the L2Character, Launch/Stop a HP/MP/CP Regeneration Task and send StatusUpdate packet to all other L2PcInstance to inform (exclusive broadcast)
setCurrentHpMp(getMaxHp(), getMaxMp());
        setCurrentCp(getMaxCp());    
if (getLevel() == 20)
	teleToLocation(-84318,244579,-3730);                
}

Link to comment
Share on other sites

  • 0

Is it work?

 

	public void increaseLevel()
{
	// Set the current HP and MP of the L2Character, Launch/Stop a HP/MP/CP Regeneration Task and send StatusUpdate packet to all other L2PcInstance to inform (exclusive broadcast)
	setCurrentHpMp(getMaxHp(), getMaxMp());
	setCurrentCp(getMaxCp());

+		if(Config.LEVEL_TELEPORT_ALLOWED)
+	
+		if (getLevel() == Config.LEVEL_COUNT)
+			teleToLocation(-84318,244579,-3730);
+		sendMessage("You will be teleporting on bla bla");
}

Link to comment
Share on other sites

  • 0

public void increaseLevel()
{
	// Set the current HP and MP of the L2Character, Launch/Stop a HP/MP/CP Regeneration Task and send StatusUpdate packet to all other L2PcInstance to inform (exclusive broadcast)
	setCurrentHpMp(getMaxHp(), getMaxMp());
	setCurrentCp(getMaxCp());

+		if(Config.LEVEL_TELEPORT_ALLOWED)
+	{
+		if (getLevel() == Config.LEVEL_COUNT)
+			teleToLocation(-84318,244579,-3730);
+		sendMessage("You will be teleporting on bla bla");
+           }
}

 

better.

 

btw you 'll need to register the config @config.java aswell.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...