Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- EmuDevs
- http://emudevs.com
- Tutorial
- */
- class npc_tutorial_playerscript : public PlayerScript
- {
- public:
- npc_tutorial_playerscript() : PlayerScript("npc_tutorial_playerscript") { }
- void OnLevelChanged(Player* player, uint8 oldLevel)
- {
- if (oldLevel == 55)
- player->AddItem(30000, 3);
- }
- void OnFreeTalentPointsChanged(Player* player, uint32 points)
- {
- switch (points)
- {
- case 5:
- Randomize(player);
- break;
- case 10:
- Randomize(player);
- break;
- case 15:
- Randomize(player);
- break;
- }
- }
- void Randomize(Player* player)
- {
- int rand = urand(0, 2);
- if (rand == 0)
- player->SetFreeTalentPoints(player->GetFreeTalentPoints() + 2);
- else if (rand == 1)
- player->SetFreeTalentPoints(player->GetFreeTalentPoints() + 4);
- else if (rand == 2)
- player->SetFreeTalentPoints(player->GetFreeTalentPoints() + 6);
- player->GetSession()->SendNotification("You received more talent points after spending or receiving them!");
- }
- };
- void AddSC_tutorial_playerscript()
- {
- new npc_tutorial_playerscript;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement