From 0676da0ea100f853e85776e5eaa5ddc42b023521 Mon Sep 17 00:00:00 2001 From: Ramus Date: Mon, 21 Mar 2011 13:21:19 +0200 Subject: [PATCH 1/5] Allow apply .modify scale to targeted creature. --- sql/base/world_database.sql | 2 +- src/server/scripts/Commands/cs_modify.cpp | 27 +++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index caea467b71..790f3d8726 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -502,7 +502,7 @@ INSERT INTO `command` VALUES ('modify rage',1,'Syntax: .modify rage #newrage\r\n\r\nModify the rage of the selected player. If no player is selected, modify your rage.'), ('modify rep',2,'Syntax: .modify rep #repId (#repvalue | $rankname [#delta])\r\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\r\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\r\nYou can use ''.pinfo rep'' to list all known reputation ids, or use ''.lookup faction $name'' to locate a specific faction id.'), ('modify runicpower',1,'Syntax: .modify runicpower #newrunicpower\r\n\r\nModify the runic power of the selected player. If no player is selected, modify your runic power.'), -('modify scale',1,'.modify scale $parameter\nModify size of the selected player to \"normal scale\"*rate. If no player is selected, modify your size.\n#rate may range from 0.1 to 10.'), +('modify scale',1,'.modify scale #scale\nModify size of the selected player or creature to \"normal scale\"*rate. If no player or creature is selected, modify your size.\n#rate may range from 0.1 to 10.'), ('modify speed',1,'Syntax: .modify speed #rate\r\n.speed #rate\r\n\r\nModify the running speed of the selected player to \"normal base run speed\"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), ('modify spell',1,'TODO'), ('modify standstate',2,'Syntax: .modify standstate #emoteid\r\n\r\nChange the emote of your character while standing to #emoteid.'), diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 60944575d6..8902e0757e 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -676,35 +676,38 @@ public: return true; } - //Edit Player Scale + //Edit Player or Creature Scale static bool HandleModifyScaleCommand(ChatHandler* handler, const char* args) { if (!*args) return false; float Scale = (float)atof((char*)args); - if (Scale > 10.0f || Scale < 0.1f) + if (Scale > 10.0f || Scale < 0.0f) { handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); return false; } - Player* target = handler->getSelectedPlayer(); + Unit* target = handler->getSelectedUnit(); if (!target) { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); handler->SetSentErrorMessage(true); return false; } - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink(target).c_str()); - if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale); + + if (target->GetTypeId()==TYPEID_PLAYER) + { + // check online security + if (handler->HasLowerSecurity((Player*)target, 0)) + return false; + + handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, Scale, handler->GetNameLink((Player*)target).c_str()); + if (handler->needReportToTarget((Player*)target)) + (ChatHandler((Player*)target)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale); + } target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale); From 6ee47ad22ff56104983e97afc167795472888914 Mon Sep 17 00:00:00 2001 From: Ramus Date: Mon, 21 Mar 2011 13:50:50 +0200 Subject: [PATCH 2/5] Fix Combustion bug exploit Add forgotten file from previous commit --- sql/base/world_database.sql | 2 +- sql/updates/world/2011_03_21_2_world_command.sql | 3 +++ sql/updates/world/2011_03_21_3_world_spell_proc_event.sql | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2011_03_21_2_world_command.sql create mode 100644 sql/updates/world/2011_03_21_3_world_spell_proc_event.sql diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 790f3d8726..8dbb5be885 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -18376,7 +18376,7 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 11095, 0x00, 3, 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Scorch (Rank 1) ( 11119, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 1) ( 11120, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Ignite (Rank 2) -( 11129, 0x04, 3, 0x08c00017, 0x00031048, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Combustion +( 11129, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Combustion ( 11180, 0x10, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Winter's Chill (Rank 1) ( 11185, 0x00, 3, 0x00000080, 0x00000000, 0x00000000, 0x00050000, 0x00000000, 0, 0, 0), -- Improved Blizzard (Rank 1) ( 11255, 0x00, 3, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Improved Counterspell (Rank 1) diff --git a/sql/updates/world/2011_03_21_2_world_command.sql b/sql/updates/world/2011_03_21_2_world_command.sql new file mode 100644 index 0000000000..0c16d9b758 --- /dev/null +++ b/sql/updates/world/2011_03_21_2_world_command.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name`='modify scale'; +INSERT INTO `command` VALUES +('modify scale',1,'.modify scale #scale\nModify size of the selected player or creature to \"normal scale\"*rate. If no player or creature is selected, modify your size.\n#rate may range from 0.1 to 10.'); \ No newline at end of file diff --git a/sql/updates/world/2011_03_21_3_world_spell_proc_event.sql b/sql/updates/world/2011_03_21_3_world_spell_proc_event.sql new file mode 100644 index 0000000000..5e1d017fb3 --- /dev/null +++ b/sql/updates/world/2011_03_21_3_world_spell_proc_event.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=11129; +INSERT INTO `spell_proc_event` VALUES (11129, 0x04, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Combustion \ No newline at end of file From 5908b2af477c6ffb5fc37829bb05b8a80942831b Mon Sep 17 00:00:00 2001 From: Ramusik Date: Sun, 10 Apr 2011 08:46:47 +0300 Subject: [PATCH 3/5] Fixed Starfall: root effect shouldn't supress the starfall effect --- src/server/game/Spells/SpellEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 10edae9346..565e1d2d4b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1364,7 +1364,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } //Any effect which causes you to lose control of your character will supress the starfall effect. - if (m_caster->HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) + if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED)) return; m_caster->CastSpell(unitTarget, damage, true); From 66081a3532a000c36ee8aee9878294a5d9674d40 Mon Sep 17 00:00:00 2001 From: Ramusik Date: Sun, 10 Apr 2011 08:53:43 +0300 Subject: [PATCH 4/5] Dislodged Foreign Object shouldn't proc from healing spells --- sql/base/world_database.sql | 4 ++-- sql/updates/world/dislodged Foreign Object.sql | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/dislodged Foreign Object.sql diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 8dbb5be885..683e68f94a 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -19393,14 +19393,14 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 71519, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 105), -- Item - Deathbringer's Will Trinket Normal ( 71540, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Whispering Fanged Skull (Heroic) ( 71562, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 105), -- Item - Deathbringer's Will Trinket Heroic -( 71602, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dislodged Foreign Object +( 71602, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 45), -- Dislodged Foreign Object ( 71606, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 100), -- Phylactery of the Nameless Lich ( 71611, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Althor's Abacus ( 71634, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Corpse Tongue Coin ( 71637, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 100), -- Phylactery of the Nameless Lich (Heroic) ( 71640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Corpse Tongue Coin (Heroic) ( 71642, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Althor's Abacus (Heroic) -( 71645, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dislodged Foreign Object (Heroic) +( 71645, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0, 0, 45), -- Dislodged Foreign Object (Heroic) ( 71880, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Heartpierce ( 71892, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Heartpierce (Heroic) ( 72417, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Item - Icecrown Reputation Ring Caster Trigger diff --git a/sql/updates/world/dislodged Foreign Object.sql b/sql/updates/world/dislodged Foreign Object.sql new file mode 100644 index 0000000000..247af7ad89 --- /dev/null +++ b/sql/updates/world/dislodged Foreign Object.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags`=0x00010000 WHERE `entry` IN (71602,71645); -- Dislodged Foreign Object \ No newline at end of file From 1c063696ace9c04bad3ad05df11dcaa472a997db Mon Sep 17 00:00:00 2001 From: Ramusik Date: Mon, 11 Apr 2011 13:26:28 +0300 Subject: [PATCH 5/5] Learn all my spells command should learn obly player's skills --- src/server/scripts/Commands/cs_learn.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index d78da69698..0b45273d76 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -795,9 +795,13 @@ public: return true; uint32 family = clsEntry->spellfamily; - for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) + for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(i); + SkillLineAbilityEntry const *entry = sSkillLineAbilityStore.LookupEntry(i); + if (!entry) + continue; + + SpellEntry const *spellInfo = sSpellStore.LookupEntry(entry->spellId); if (!spellInfo) continue; @@ -822,7 +826,7 @@ public: if (!SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer(),false)) continue; - handler->GetSession()->GetPlayer()->learnSpell(i, false); + handler->GetSession()->GetPlayer()->learnSpell(spellInfo->Id, false); } handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);