aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp2
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp10
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp27
3 files changed, 23 insertions, 16 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index fb78807d15f..7d1fc92113c 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1363,7 +1363,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);
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 347a527bead..e9746611818 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -148,9 +148,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;
@@ -175,7 +179,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);
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 697129f2135..79422531a77 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);