• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Assist the court in Script

Status
Not open for further replies.

Come2WoW

Respected Member
Hi guys's , I have just Humer up the Script.
But this only works for one level .
It is something that we can change the location of the level to be?

For example, the:
Level at 19 to go to shattrat ,Level was 45 when she dalaran

class lvl_change : public PlayerScript
{
public:
lvl_change() : PlayerScript("lvl_change") { }

void OnLevelChanged(Player * player, uint8 newLevel)
{
if(newLevel == 79)
player->TeleportTo(1, -6349.085938, 3315.571533, 70.443832, 0.235934); // MapId, x, y, z, o
}
};
void AddSC_level_change()
{
new lvl_change;
}
 

Rochet2

Moderator / Eluna Dev
This is going to take a lot of resources if it is called every time someone levels o.0

I dont think leveling happens that often :p
Besides its the best way and the code is not heavy. You HAVE to check it on every level up anyways. Its not like the code can know when you hit the right level without checking at all :3

BTW. It is OLD level, not new level. So you need to check if the newlevel argument (really old level) is 18
OR you can use getLevel() for the player and check if that is 19.

Code:
class lvl_change : public PlayerScript
{
public:
	lvl_change() : PlayerScript("lvl_change") { }

	void OnLevelChanged(Player * player, uint8 newLevel)
	{
		switch (player->getLevel())
		{
		case 19:
			player->TeleportTo(1, -6349.085938, 3315.571533, 70.443832, 0.235934); // MapId, x, y, z, o to shattrath
			break;
		case 45:
			player->TeleportTo(1, -6349.085938, 3315.571533, 70.443832, 0.235934); // MapId, x, y, z, o to dalaran
			break;
		}
	}
};

void AddSC_level_change()
{
	new lvl_change;
}

change the coordinates
 
Last edited:
Status
Not open for further replies.
Top