From 0676da0ea100f853e85776e5eaa5ddc42b023521 Mon Sep 17 00:00:00 2001 From: Ramus Date: Mon, 21 Mar 2011 13:21:19 +0200 Subject: Allow apply .modify scale to targeted creature. --- src/server/scripts/Commands/cs_modify.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 60944575d68..8902e0757ea 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); -- cgit v1.2.3 From 1c063696ace9c04bad3ad05df11dcaa472a997db Mon Sep 17 00:00:00 2001 From: Ramusik Date: Mon, 11 Apr 2011 13:26:28 +0300 Subject: 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(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index d78da696987..0b45273d763 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); -- cgit v1.2.3 From ae7d55bb3bb2fcbd04c404a13662c5d948ff6abf Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 5 May 2011 22:22:12 +0300 Subject: Core/Misc: Corrections after recent pull merge --- sql/updates/world/2011_03_21_2_world_command.sql | 3 --- sql/updates/world/2011_03_21_3_world_spell_proc_event.sql | 2 -- sql/updates/world/2011_05_05_00_world_command.sql | 3 +++ sql/updates/world/2011_05_05_01_spell_proc_event.sql | 1 + sql/updates/world/dislodged Foreign Object.sql | 1 - src/server/scripts/Commands/cs_modify.cpp | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 sql/updates/world/2011_03_21_2_world_command.sql delete mode 100644 sql/updates/world/2011_03_21_3_world_spell_proc_event.sql create mode 100644 sql/updates/world/2011_05_05_00_world_command.sql create mode 100644 sql/updates/world/2011_05_05_01_spell_proc_event.sql delete mode 100644 sql/updates/world/dislodged Foreign Object.sql (limited to 'src/server/scripts/Commands') diff --git a/sql/updates/world/2011_03_21_2_world_command.sql b/sql/updates/world/2011_03_21_2_world_command.sql deleted file mode 100644 index 0c16d9b7580..00000000000 --- a/sql/updates/world/2011_03_21_2_world_command.sql +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 5e1d017fb3a..00000000000 --- a/sql/updates/world/2011_03_21_3_world_spell_proc_event.sql +++ /dev/null @@ -1,2 +0,0 @@ -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 diff --git a/sql/updates/world/2011_05_05_00_world_command.sql b/sql/updates/world/2011_05_05_00_world_command.sql new file mode 100644 index 00000000000..b31ffc2ff0a --- /dev/null +++ b/sql/updates/world/2011_05_05_00_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.'); diff --git a/sql/updates/world/2011_05_05_01_spell_proc_event.sql b/sql/updates/world/2011_05_05_01_spell_proc_event.sql new file mode 100644 index 00000000000..6c5db5d3663 --- /dev/null +++ b/sql/updates/world/2011_05_05_01_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags`=0x00010000 WHERE `entry` IN (71602, 71645); diff --git a/sql/updates/world/dislodged Foreign Object.sql b/sql/updates/world/dislodged Foreign Object.sql deleted file mode 100644 index 247af7ad891..00000000000 --- a/sql/updates/world/dislodged Foreign Object.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `spell_proc_event` SET `procFlags`=0x00010000 WHERE `entry` IN (71602,71645); -- Dislodged Foreign Object \ No newline at end of file diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 79422531a77..9e3851ccc8a 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -683,7 +683,7 @@ public: return false; float Scale = (float)atof((char*)args); - if (Scale > 10.0f || Scale < 0.0f) + if (Scale > 10.0f || Scale < 0.1f) { handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); -- cgit v1.2.3