aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2008-11-09 14:54:13 -0600
committermegamage <none@none>2008-11-09 14:54:13 -0600
commitee02a2fc84c564d82a062bd975281a4e4f0fefa0 (patch)
tree5bb99bbf8fae0f83fad278e766e1df2e80197be1 /src/game
parent2c83fc42fc0bd963940047b1088f91c8b7474799 (diff)
[svn] Send AttackStart package when update visibility.
Update DoMeleeAttackIfReady to support dual wield. Show player modelid2 instead id3 of triggers. This should fix the bug that gameobject::castspell summon a human model. Remove the correct flag to make creature attackable. This should fix the bug that Illidan and Magtheridon are unattackable. Add NullCreatureAI for trinityscript. Fix channeler's soul transfer. Some update of black temple scripts. --HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameObject.cpp2
-rw-r--r--src/game/Object.cpp14
-rw-r--r--src/game/Player.cpp21
-rw-r--r--src/game/Spell.cpp2
-rw-r--r--src/game/Unit.h3
5 files changed, 35 insertions, 7 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index fbeb30144bb..595759a5451 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1282,4 +1282,6 @@ void GameObject::CastSpell(Unit* target, uint32 spell)
trigger->setFaction(14);
trigger->CastSpell(target, spell, true);
}
+ //trigger->setDeathState(JUST_DIED);
+ //trigger->RemoveCorpse();
} \ No newline at end of file
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 568e9a90a31..0ceb71367ca 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -601,9 +601,19 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
if(cinfo->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
{
if(target->isGameMaster())
- *data << cinfo->Modelid1;
+ {
+ if(cinfo->Modelid2)
+ *data << cinfo->Modelid1;
+ else
+ *data << 17519; // world invisible trigger's model
+ }
else
- *data << cinfo->Modelid3;
+ {
+ if(cinfo->Modelid2)
+ *data << cinfo->Modelid2;
+ else
+ *data << 11686; // world invisible trigger's model
+ }
}
else
*data << m_uint32Values[ index ];
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index b00dadc98dd..23aae2cd363 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -16406,7 +16406,16 @@ void Player::HandleStealthedUnitsDetection()
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
if((*i)!=this && (*i)->isType(TYPEMASK_UNIT))
+ {
SendAuraDurationsForTarget(*i);
+ //if(((Unit*)(*i))->isAlive()) //should be always alive
+ {
+ if((*i)->GetTypeId()==TYPEID_UNIT)
+ ((Creature*)(*i))->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)(*i))->getVictim())
+ ((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim());
+ }
+ }
i = stealthedUnits.erase(i);
continue;
@@ -17386,10 +17395,16 @@ void Player::UpdateVisibilityOf(WorldObject* target)
// target aura duration for caster show only if target exist at caster client
// send data at target visibility change (adding to client)
if(target!=this && target->isType(TYPEMASK_UNIT))
+ {
SendAuraDurationsForTarget((Unit*)target);
-
- if(target->GetTypeId()==TYPEID_UNIT && ((Creature*)target)->isAlive())
- ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)target)->isAlive())
+ {
+ if(target->GetTypeId()==TYPEID_UNIT)
+ ((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this);
+ if(((Unit*)target)->getVictim())
+ ((Unit*)target)->SendAttackStart(((Unit*)target)->getVictim());
+ }
+ }
}
}
}
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4570e7590cc..95f315c5c13 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1012,7 +1012,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
// TODO: this cause soul transfer bugged
- if(m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id))
+ if(m_spellInfo->speed > 0.0f && unit->GetTypeId() == TYPEID_PLAYER && !IsPositiveSpell(m_spellInfo->Id))
{
m_caster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
return;
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 0f2949b6ee3..61dcaf0d1cd 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -942,6 +942,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void DeMorph();
+ void SendAttackStart(Unit* pVictim);
void SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
void SendSpellNonMeleeDamageLog(Unit *target,uint32 SpellID,uint32 Damage, SpellSchoolMask damageSchoolMask,uint32 AbsorbedDamage, uint32 Resist,bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo);
@@ -1352,7 +1353,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
private:
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
- void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
+ //void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, AuraTypeSet const& procAuraTypes, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage, SpellSchoolMask damageSchoolMask );
bool HandleDummyAuraProc(Unit *pVictim, SpellEntry const *spellProto, uint32 effIndex, uint32 damage, Aura* triggredByAura, SpellEntry const * procSpell, uint32 procFlag,uint32 cooldown);