Skip to content

Instantly share code, notes, and snippets.

@devovh
Forked from Rochet2/lo.cpp
Created June 19, 2014 01:07
Show Gist options
  • Save devovh/9819f6855e149de52d34 to your computer and use it in GitHub Desktop.
Save devovh/9819f6855e149de52d34 to your computer and use it in GitHub Desktop.
//script made by SymbolixDEV
#include "ScriptPCH.h"
class login_script : public PlayerScript
{
public:
login_script() : PlayerScript("login_script") { }
void OnLogin(Player* player)
{
std::string msg;
if (player->GetSession()->GetSecurity() != SEC_PLAYER)
msg = "[GM]:";
else
msg = "[PLAYER]:";
msg += player->GetName()+" has logged in!";
sWorld->SendGlobalText(msg.c_str(), NULL);
player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA)); // set max mana
player->SetPower(POWER_ENERGY, player->GetMaxPower(POWER_ENERGY)); //set max rogue/druid enery go on login!
player->SetPower(POWER_RAGE, player->GetMaxPower(POWER_RAGE)); //set max warrior rage on login!
player->SetPower(POWER_RUNIC_POWER, player->GetMaxPower(POWER_RUNIC_POWER)); //set max runic power on Death Knight on login!
player->SetFullHealth(); // set max health on login on game !
player->RemoveAllSpellCooldown(); //reset cooldowns on login!
}
};
void AddSC_login_script()
{
new login_script();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment