From 2c441808f13a1005d5107e64de55cebe2c5aa6db Mon Sep 17 00:00:00 2001 From: Geodar Date: Sat, 8 Sep 2012 08:02:00 +0200 Subject: Core/Scripts: Fix Typo in 7121f015ed6561a4bc12cf08d8f9286b113e66ad --- src/server/scripts/Spells/spell_warlock.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/scripts') 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(); -- cgit v1.2.3 From 9c54cf3312fff7fe08782566307ced6ff987d851 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 8 Sep 2012 13:24:42 +0200 Subject: Core: Fix warnings --- .../CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts') 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*/) {} }; }; -- cgit v1.2.3 From b8343391c2db98972d67ebc7d86871c871e29f9f Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 8 Sep 2012 07:41:35 -0500 Subject: Core/Scripts: Muglash should walk instead of running. --- src/server/scripts/Kalimdor/ashenvale.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts') 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; -- cgit v1.2.3 From 5cd9910463b9bad187c3dbdcd06350a329fc823e Mon Sep 17 00:00:00 2001 From: Myran2 Date: Sat, 8 Sep 2012 18:59:06 -0400 Subject: Core/Commands: Replaced .start with a new command, .unstuck. Usage information can be found by typing .unstuck in-game --- sql/updates/world/2012_8_31_00_world_command.sql | 2 + .../world/2012_8_31_01_world_trinity_string.sql | 2 + src/server/game/Miscellaneous/Language.h | 3 +- src/server/scripts/Commands/cs_misc.cpp | 63 +++++++++++++++++----- 4 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 sql/updates/world/2012_8_31_00_world_command.sql create mode 100644 sql/updates/world/2012_8_31_01_world_trinity_string.sql (limited to 'src/server/scripts') diff --git a/sql/updates/world/2012_8_31_00_world_command.sql b/sql/updates/world/2012_8_31_00_world_command.sql new file mode 100644 index 00000000000..28e70f3fa72 --- /dev/null +++ b/sql/updates/world/2012_8_31_00_world_command.sql @@ -0,0 +1,2 @@ +DELETE FROM `command` WHERE `name` = 'start'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES ('unstuck', 0, 'Syntax: .unstuck $playername [inn/graveyard/startzone]\r\n\r\nTeleports specified player to specified location. Default location is player\'s current hearth location.'); \ No newline at end of file diff --git a/sql/updates/world/2012_8_31_01_world_trinity_string.sql b/sql/updates/world/2012_8_31_01_world_trinity_string.sql new file mode 100644 index 00000000000..701c85bce9c --- /dev/null +++ b/sql/updates/world/2012_8_31_01_world_trinity_string.sql @@ -0,0 +1,2 @@ +DELETE FROM `trinity_string` WHERE `entry`=63 LIMIT 1; --Existing entry 63 is not present in Language.h. It's safe to remove it. +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES (63, 'You can\'t do that right now.'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index a766108dbb0..9c4f760fcff 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -86,7 +86,8 @@ enum TrinityStrings LANG_CONNECTED_PLAYERS = 60, LANG_ACCOUNT_ADDON = 61, LANG_IMPROPER_VALUE = 62, - // Room for more level 0 63-99 not used + LANG_CANT_DO_NOW = 63, + // Room for more level 0 64-99 not used // level 1 chat LANG_GLOBAL_NOTIFY = 100, diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index fea96cc80f3..d985671997a 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,69 @@ 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; + } + + //7355: "Stuck" + player->CastSpell(player, 7355, false); + return true; + } + + if (!*args) + return false; + + char* player_str = strtok((char*)args, " "); + if (!player_str) + return false; - if (player->isInFlight()) + 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 + sLog->outError(LOG_FILTER_GENERAL, "DEBUG: not a supported argument. Args were: %s", args); + return false; + } static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args) -- cgit v1.2.3 From c243185a3a3c0533cb36a376ebf45f513d987b30 Mon Sep 17 00:00:00 2001 From: Myran2 Date: Sat, 8 Sep 2012 19:01:33 -0400 Subject: Removed a line of debug code --- src/server/scripts/Commands/cs_misc.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d985671997a..835204e1eb9 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -988,7 +988,6 @@ public: } //Not a supported argument - sLog->outError(LOG_FILTER_GENERAL, "DEBUG: not a supported argument. Args were: %s", args); return false; } -- cgit v1.2.3 From d04f155b6529e3d86fca931075775fd34b544e29 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 9 Sep 2012 00:10:23 +0100 Subject: Corrections to previous merged in PR --- sql/updates/world/2012_09_09_00_world_command.sql | 4 ++++ sql/updates/world/2012_09_09_01_world_trinity_string.sql | 3 +++ sql/updates/world/2012_8_31_00_world_command.sql | 2 -- sql/updates/world/2012_8_31_01_world_trinity_string.sql | 2 -- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 4 ++-- src/server/scripts/Commands/cs_misc.cpp | 6 +++--- 8 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 sql/updates/world/2012_09_09_00_world_command.sql create mode 100644 sql/updates/world/2012_09_09_01_world_trinity_string.sql delete mode 100644 sql/updates/world/2012_8_31_00_world_command.sql delete mode 100644 sql/updates/world/2012_8_31_01_world_trinity_string.sql (limited to 'src/server/scripts') diff --git a/sql/updates/world/2012_09_09_00_world_command.sql b/sql/updates/world/2012_09_09_00_world_command.sql new file mode 100644 index 00000000000..1fb3247bfbb --- /dev/null +++ b/sql/updates/world/2012_09_09_00_world_command.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` = 'start'; +DELETE FROM `command` WHERE `name` = 'unstuck'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('unstuck', 0, 'Syntax: .unstuck $playername [inn/graveyard/startzone]\n\nTeleports specified player to specified location. Default location is player\'s current hearth location.'); diff --git a/sql/updates/world/2012_09_09_01_world_trinity_string.sql b/sql/updates/world/2012_09_09_01_world_trinity_string.sql new file mode 100644 index 00000000000..2f3c0aa1938 --- /dev/null +++ b/sql/updates/world/2012_09_09_01_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=63; -- Existing entry 63 is not present in Language.h. It's safe to remove it. +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(63, 'You can''t do that right now.'); diff --git a/sql/updates/world/2012_8_31_00_world_command.sql b/sql/updates/world/2012_8_31_00_world_command.sql deleted file mode 100644 index 28e70f3fa72..00000000000 --- a/sql/updates/world/2012_8_31_00_world_command.sql +++ /dev/null @@ -1,2 +0,0 @@ -DELETE FROM `command` WHERE `name` = 'start'; -INSERT INTO `command` (`name`, `security`, `help`) VALUES ('unstuck', 0, 'Syntax: .unstuck $playername [inn/graveyard/startzone]\r\n\r\nTeleports specified player to specified location. Default location is player\'s current hearth location.'); \ No newline at end of file diff --git a/sql/updates/world/2012_8_31_01_world_trinity_string.sql b/sql/updates/world/2012_8_31_01_world_trinity_string.sql deleted file mode 100644 index 701c85bce9c..00000000000 --- a/sql/updates/world/2012_8_31_01_world_trinity_string.sql +++ /dev/null @@ -1,2 +0,0 @@ -DELETE FROM `trinity_string` WHERE `entry`=63 LIMIT 1; --Existing entry 63 is not present in Language.h. It's safe to remove it. -INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES (63, 'You can\'t do that right now.'); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 55d90ba1c18..dc3fe6b0f0b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14726,7 +14726,7 @@ bool Player::CanSeeStartQuest(Quest const* quest) bool Player::CanTakeQuest(Quest const* quest, bool msg) { - return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this) + return !DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, quest->GetQuestId(), this) && SatisfyQuestStatus(quest, msg) && SatisfyQuestExclusiveGroup(quest, msg) && SatisfyQuestClass(quest, msg) && SatisfyQuestRace(quest, msg) && SatisfyQuestLevel(quest, msg) && SatisfyQuestSkill(quest, msg) && SatisfyQuestReputation(quest, msg) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1c43c8edd62..737d75cdf1c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4367,10 +4367,10 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) if ((*i)->GetMiscValue() & misc_mask) if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) modifier += (*i)->GetAmount(); - + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) modifier += itr->second; - + return modifier; } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 5080d668702..39704828d7f 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1312,7 +1312,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) if (!go) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); - data << uint32(2); + data << uint32(2); SendPacket(&data); return; } @@ -1320,7 +1320,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) if (_player->getStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); - data << uint32(2); + data << uint32(2); SendPacket(&data); return; } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 835204e1eb9..1778dc9be67 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -940,15 +940,15 @@ public: 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; -- cgit v1.2.3