Skip to content

Instantly share code, notes, and snippets.

@Rochet2
Forked from SymbolixDEV/lo.cpp
Created February 4, 2014 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Rochet2/8812233 to your computer and use it in GitHub Desktop.
Save Rochet2/8812233 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();
}
@scorched-wow
Copy link

is this still work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment