diff options
author | megamage <none@none> | 2009-03-19 15:45:22 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-19 15:45:22 -0600 |
commit | 5b73a59f154b0748ba58e2039f52ee807fc9b5ec (patch) | |
tree | dde62793c0821f7f6818383abba529b0d925a5de /src | |
parent | e121267298b9147df9f9a8d411ee446c24011d15 (diff) |
*Set totem slot to 4 but total summon slot to 6.
*Fix build.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Level3.cpp | 41 | ||||
-rw-r--r-- | src/game/Spell.h | 3 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 81 | ||||
-rw-r--r-- | src/game/Unit.h | 3 |
4 files changed, 29 insertions, 99 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index cd8da2cb7ca..5974e818361 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2901,47 +2901,6 @@ bool ChatHandler::HandleListObjectCommand(const char* args) return true; } -bool ChatHandler::HandleGameObjectNearCommand(const char* args) -{ - float distance = (!*args) ? 10 : atol(args); - uint32 count = 0; - - Player* pl = m_session->GetPlayer(); - QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, " - "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ " - "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_", - pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), - pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance); - - if (result) - { - do - { - Field *fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - uint32 entry = fields[1].GetUInt32(); - float x = fields[2].GetFloat(); - float y = fields[3].GetFloat(); - float z = fields[4].GetFloat(); - int mapid = fields[5].GetUInt16(); - - GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry); - - if(!gInfo) - continue; - - PSendSysMessage(LANG_GO_LIST_CHAT, guid, guid, gInfo->name, x, y, z, mapid); - - ++count; - } while (result->NextRow()); - - delete result; - } - - PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE,distance,count); - return true; -} - bool ChatHandler::HandleGameObjectStateCommand(const char* args) { // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r diff --git a/src/game/Spell.h b/src/game/Spell.h index ac7106eaa62..0301f5537eb 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -598,6 +598,9 @@ class Spell void SpellDamageSchoolDmg(uint32 i); void SpellDamageWeaponDmg(uint32 i); void SpellDamageHeal(uint32 i); + + void GetSummonPosition(float &x, float &y, float &z, float radius = 0.0f, uint32 count = 0); + SpellCastResult CanOpenLock(uint32 effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue); // ------------------------------------------- diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5176bca920f..e363b2cb41e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3681,11 +3681,6 @@ void Spell::EffectSummonWild(uint32 i) } } - // select center of summon position - float center_x = m_targets.m_destX; - float center_y = m_targets.m_destY; - float center_z = m_targets.m_destZ; - float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); int32 amount = damage > 0 ? damage : 1; @@ -3693,23 +3688,7 @@ void Spell::EffectSummonWild(uint32 i) for(int32 count = 0; count < amount; ++count) { float px, py, pz; - // If dest location if present - if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) - { - // Summon 1 unit in dest location - if (count == 0) - { - px = m_targets.m_destX; - py = m_targets.m_destY; - pz = m_targets.m_destZ; - } - // Summon in random point all other units if location present - else - m_caster->GetRandomPoint(center_x,center_y,center_z,radius,px,py,pz); - } - // Summon if dest location not present near caster - else - m_caster->GetClosePoint(px,py,pz,3.0f); + GetSummonPosition(px, py, pz, radius, count); int32 duration = GetSpellDuration(m_spellInfo); @@ -5586,10 +5565,8 @@ void Spell::EffectSummonTotem(uint32 i) return; } - float angle = slot < MAX_TOTEM ? M_PI/MAX_TOTEM - (slot*2*M_PI/MAX_TOTEM) : 0; - float x,y,z; - m_caster->GetClosePoint(x,y,z,pTotem->GetObjectSize(),2.0f,angle); + GetSummonPosition(x, y, z); // totem must be at same Z in case swimming caster and etc. if( fabs( z - m_caster->GetPositionZ() ) > 5 ) @@ -6051,16 +6028,7 @@ void Spell::EffectSummonCritter(uint32 i) return; float x,y,z; - // If dest location if present - if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) - { - x = m_targets.m_destX; - y = m_targets.m_destY; - z = m_targets.m_destZ; - } - // Summon if dest location not present near caster - else - m_caster->GetClosePoint(x,y,z,m_caster->GetObjectSize()); + GetSummonPosition(x, y, z); int32 duration = GetSpellDuration(m_spellInfo); TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; @@ -6534,11 +6502,6 @@ void Spell::EffectSkill(uint32 /*i*/) void Spell::EffectSummonDemon(uint32 i) { - // select center of summon position - float center_x = m_targets.m_destX; - float center_y = m_targets.m_destY; - float center_z = m_targets.m_destZ; - float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); int32 amount = damage > 0 ? damage : 1; @@ -6546,23 +6509,7 @@ void Spell::EffectSummonDemon(uint32 i) for(int32 count = 0; count < amount; ++count) { float px, py, pz; - // If dest location if present - if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) - { - // Summon 1 unit in dest location - if (count == 0) - { - px = m_targets.m_destX; - py = m_targets.m_destY; - pz = m_targets.m_destZ; - } - // Summon in random point all other units if location present - else - m_caster->GetRandomPoint(center_x,center_y,center_z,radius,px,py,pz); - } - // Summon if dest location not present near caster - else - m_caster->GetClosePoint(px,py,pz,3.0f); + GetSummonPosition(px, py, pz, radius, count); int32 duration = GetSpellDuration(m_spellInfo); @@ -6773,6 +6720,26 @@ void Spell::EffectSummonVehicle(uint32 i) vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); } +void Spell::GetSummonPosition(float &x, float &y, float &z, float radius, uint32 count) +{ + if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) + { + // Summon 1 unit in dest location + if (count == 0) + { + x = m_targets.m_destX; + y = m_targets.m_destY; + z = m_targets.m_destZ; + } + // Summon in random point all other units if location present + else + m_caster->GetRandomPoint(m_targets.m_destX,m_targets.m_destY,m_targets.m_destZ,radius,x,y,z); + } + // Summon if dest location not present near caster + else + m_caster->GetClosePoint(x,y,z,3.0f); +} + void Spell::EffectRenamePet(uint32 /*eff_idx*/) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || diff --git a/src/game/Unit.h b/src/game/Unit.h index cee3a93339b..f153c725edf 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -822,7 +822,8 @@ enum ReactiveType }; #define MAX_REACTIVE 3 -#define MAX_TOTEM 6 +#define MAX_TOTEM 4 +#define MAX_SUMMON_SLOT 6 struct AuraSlotEntry { |