mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
Merged and updated to latest PTR build 9704
This commit is contained in:
commit
a2d3941588
22 changed files with 376 additions and 454 deletions
|
|
@ -796,7 +796,7 @@ void Spell::EffectDummy(uint32 i)
|
|||
// create before death for get proper coordinates
|
||||
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map, m_caster->GetPhaseMask(),
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, 1) )
|
||||
creatureTarget->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1) )
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
|
|
@ -4590,7 +4590,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
|||
Map *map = target->GetMap();
|
||||
|
||||
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), gameobject_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
|
|
@ -4638,7 +4638,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
|||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
|
|
@ -5263,7 +5263,7 @@ void Spell::EffectDuel(uint32 i)
|
|||
m_caster->GetPositionX()+(unitTarget->GetPositionX()-m_caster->GetPositionX())/2 ,
|
||||
m_caster->GetPositionY()+(unitTarget->GetPositionY()-m_caster->GetPositionY())/2 ,
|
||||
m_caster->GetPositionZ(),
|
||||
m_caster->GetOrientation(), 0, 0, 0, 0, 0, 1))
|
||||
m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
|
|
@ -5639,9 +5639,6 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
float rot2 = sin(m_caster->GetOrientation()/2);
|
||||
float rot3 = cos(m_caster->GetOrientation()/2);
|
||||
|
||||
float x,y,z;
|
||||
// If dest location if present
|
||||
if (m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)
|
||||
|
|
@ -5656,7 +5653,7 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
|
||||
Map *map = m_caster->GetMap();
|
||||
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), go_id, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0, 0, rot2, rot3, 0, 1))
|
||||
m_caster->GetPhaseMask(), x, y, z, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
|
|
@ -6246,7 +6243,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), name_id, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
|
|
@ -6259,10 +6256,6 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
case GAMEOBJECT_TYPE_FISHINGNODE:
|
||||
{
|
||||
m_caster->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT,pGameObj->GetGUID());
|
||||
// Orientation3
|
||||
pGameObj->SetFloatValue(GAMEOBJECT_PARENTROTATION + 2, 0.88431775569915771 );
|
||||
// Orientation4
|
||||
pGameObj->SetFloatValue(GAMEOBJECT_PARENTROTATION + 3, -0.4668855369091033 );
|
||||
m_caster->AddGameObject(pGameObj); // will removed at spell cancel
|
||||
|
||||
// end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo))
|
||||
|
|
@ -6317,7 +6310,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, 1))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
|
||||
|
|
@ -6386,26 +6379,55 @@ void Spell::EffectSkill(uint32 /*i*/)
|
|||
|
||||
void Spell::EffectSummonDemon(uint32 i)
|
||||
{
|
||||
float px = m_targets.m_destX;
|
||||
float py = m_targets.m_destY;
|
||||
float pz = m_targets.m_destZ;
|
||||
// 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;
|
||||
|
||||
Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,3600000);
|
||||
if (!Charmed)
|
||||
return;
|
||||
float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
|
||||
// might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
|
||||
Charmed->SetLevel(m_caster->getLevel());
|
||||
int32 amount = damage > 0 ? damage : 1;
|
||||
|
||||
// TODO: Add damage/mana/hp according to level
|
||||
|
||||
if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon
|
||||
for(int32 count = 0; count < amount; ++count)
|
||||
{
|
||||
// Enslave demon effect, without mana cost and cooldown
|
||||
m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved
|
||||
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);
|
||||
|
||||
// Inferno effect
|
||||
Charmed->CastSpell(Charmed, 22703, true, 0);
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
|
||||
Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,duration);
|
||||
if (!Charmed) // something fatal, not attempt more
|
||||
return;
|
||||
|
||||
// might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster?
|
||||
Charmed->SetLevel(m_caster->getLevel());
|
||||
|
||||
// TODO: Add damage/mana/hp according to level
|
||||
|
||||
if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon
|
||||
{
|
||||
// Enslave demon effect, without mana cost and cooldown
|
||||
m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved
|
||||
|
||||
// Inferno effect
|
||||
Charmed->CastSpell(Charmed, 22703, true, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue