diff options
author | Nay <dnpd.dd@gmail.com> | 2012-09-09 02:26:31 +0100 |
---|---|---|
committer | Nay <dnpd.dd@gmail.com> | 2012-09-09 02:26:31 +0100 |
commit | 50327363ca764347b508d7b5e736db631f2be45c (patch) | |
tree | 076f22d7da5a5fe4c330af588b221170dae88366 /src/server/scripts | |
parent | 6c1bdb3d3c319e999bfbf3c3a16701569ce04d22 (diff) | |
parent | d04f155b6529e3d86fca931075775fd34b544e29 (diff) |
Merge remote-tracking branch 'origin/master' into mmaps
Diffstat (limited to 'src/server/scripts')
4 files changed, 58 insertions, 24 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index fea96cc80f3..1778dc9be67 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -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(); + //No args required for players + if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity())) + { + Player* player = handler->GetSession()->GetPlayer(); + if (player->isInFlight() || player->isInCombat()) + { + handler->SendSysMessage(LANG_CANT_DO_NOW); + handler->SetSentErrorMessage(true); + return false; + } - if (player->isInFlight()) + //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_YOU_IN_FLIGHT); + 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) diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 248932ecbb6..6a9dd77433a 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -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; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index ea51f07dbe3..87e7801566e 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -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*/) {} }; }; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index a48661d4aed..0def62b7d3a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -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(); |