Merge remote-tracking branch 'origin/master' into 4.3.4

Conflicts:
	sql/base/characters_database.sql
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Handlers/CharacterHandler.cpp
This commit is contained in:
Nay
2012-09-09 02:18:58 +01:00
20 changed files with 149 additions and 39 deletions

View File

@@ -81,7 +81,7 @@ public:
{ "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL },
{ "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL },
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL },
{ "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL },
{ "unstuck", SEC_PLAYER, true, &HandleUnstuckCommand, "", NULL },
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL },
{ "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL },
{ "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL },
@@ -928,34 +928,68 @@ public:
return true;
}
static bool HandleStartCommand(ChatHandler* handler, char const* /*args*/)
static bool HandleUnstuckCommand(ChatHandler* handler, char const* args)
{
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight())
//No args required for players
if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
{
handler->SendSysMessage(LANG_YOU_IN_FLIGHT);
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
return false;
}
//7355: "Stuck"
player->CastSpell(player, 7355, false);
return true;
}
if (!*args)
return false;
char* player_str = strtok((char*)args, " ");
if (!player_str)
return false;
char* location_str = strtok(NULL, "");
if (!location_str)
location_str = "inn";
Player* player = NULL;
std::string playerName;
if (!handler->extractPlayerTarget((char*)player_str, &player, NULL, &playerName))
return false;
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
return false;
}
if (player->isInCombat())
if (!stricmp(location_str, "inn"))
{
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
handler->SetSentErrorMessage(true);
return false;
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
return true;
}
if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
if (!stricmp(location_str, "graveyard"))
{
// if player is dead and stuck, send ghost to graveyard
player->RepopAtGraveyard();
return true;
}
// cast spell Stuck
player->CastSpell(player, 7355, false);
return true;
if (!stricmp(location_str, "startzone"))
{
player->TeleportTo(player->GetStartPosition());
return true;
}
//Not a supported argument
return false;
}
static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)

View File

@@ -447,7 +447,7 @@ class npc_muglash : public CreatureScript
DoScriptText(SAY_MUG_START1, creature);
creature->setFaction(113);
pEscortAI->Start(true, true, player->GetGUID());
pEscortAI->Start(true, false, player->GetGUID());
}
}
return true;

View File

@@ -330,7 +330,7 @@ public:
me->DespawnOrUnsummon();
}
void UpdateAI(uint32 const diff) {}
void UpdateAI(uint32 const /*diff*/) {}
};
};
@@ -441,7 +441,7 @@ public:
me->DespawnOrUnsummon();
}
void UpdateAI(uint32 const diff) {}
void UpdateAI(uint32 const /*diff*/) {}
};
};

View File

@@ -679,38 +679,38 @@ class spell_warl_health_funnel : public SpellScriptLoader
{
public:
spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { }
class spell_warl_health_funnel_AuraScript : public AuraScript
{
PrepareAuraScript(spell_warl_health_funnel_AuraScript)
PrepareAuraScript(spell_warl_health_funnel_AuraScript);
void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
Unit* target = GetTarget();
if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true);
else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1))
target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true);
}
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1);
target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2);
}
void Register()
{
OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_warl_health_funnel_AuraScript();