From c5175e5e470f6c630b4c8659f0e0e6a1094891cc Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Thu, 5 Mar 2009 17:25:29 +0100 Subject: *Implement SCRIPT_COMMAND_KILL for database scripting --HG-- branch : trunk --- src/game/World.cpp | 15 +++++++++++++++ src/game/World.h | 1 + 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/game/World.cpp b/src/game/World.cpp index 7adb9f4d24f..b722f67f827 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -2426,6 +2426,21 @@ void World::ScriptsProcess() break; } + case SCRIPT_COMMAND_KILL: + { + if(!source || ((Creature*)source)->isDead()) + break; + + ((Creature*)source)->DealDamage(((Creature*)source), ((Creature*)source)->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + switch(step.script->dataint) + { + case 0: break; //return false not remove corpse + case 1: ((Creature*)source)->RemoveCorpse(); break; + } + break; + } + default: sLog.outError("Unknown script command %u called.",step.script->command); break; diff --git a/src/game/World.h b/src/game/World.h index 4848c87ca5f..8b6fe46b561 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -331,6 +331,7 @@ enum RealmZone #define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2 #define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table #define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self +#define SCRIPT_COMMAND_KILL 19 // datalong removecorpse /// Storage class for commands issued for delayed execution -- cgit v1.2.3 From b7ec91f72d640bb694b82b0adafaa66935174d42 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 5 Mar 2009 13:08:46 -0600 Subject: *Do not let farsight dynobj apply non-exist auras. This fixed farsight. --HG-- branch : trunk --- src/game/DynamicObject.cpp | 13 ++++++++----- src/game/SpellEffects.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp index 0ae3656fc9d..fd3e16e79d7 100644 --- a/src/game/DynamicObject.cpp +++ b/src/game/DynamicObject.cpp @@ -113,12 +113,15 @@ void DynamicObject::Update(uint32 p_time) else deleteThis = true; - if(m_updateTimer < p_time) + if(m_effIndex < 4) { - Trinity::DynamicObjectUpdater notifier(*this,caster); - VisitNearbyObject(GetRadius(), notifier); - m_updateTimer = 500; // is this official-like? - }else m_updateTimer -= p_time; + if(m_updateTimer < p_time) + { + Trinity::DynamicObjectUpdater notifier(*this,caster); + VisitNearbyObject(GetRadius(), notifier); + m_updateTimer = 500; // is this official-like? + }else m_updateTimer -= p_time; + } if(deleteThis) { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index dbdef569a5c..cad6190294d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3485,7 +3485,7 @@ void Spell::EffectAddFarsight(uint32 i) float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); int32 duration = GetSpellDuration(m_spellInfo); DynamicObject* dynObj = new DynamicObject; - if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, i, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) + if(!dynObj->Create(objmgr.GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, 4, m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, duration, radius)) { delete dynObj; return; -- cgit v1.2.3 From 21f35e15d90616831150f0d8a5100b5449df8437 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 5 Mar 2009 13:09:51 -0600 Subject: *Do not calculate level-based spell damage twice. This fixed the bug that some +ap buff give mobs too high damage. --HG-- branch : trunk --- src/game/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 46ee967b466..bb0229aeef5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10613,7 +10613,7 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde } } - if(spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel && + if(!basePointsPerLevel && (spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel) && spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && spellProto->Effect[effect_index] != SPELL_EFFECT_KNOCK_BACK) //there are many more: slow speed, -healing pct -- cgit v1.2.3 From 6a577295d945dac9c43a4d4130c8fdaa70061eb3 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 5 Mar 2009 13:10:12 -0600 Subject: *Remove spams of transport log. --HG-- branch : trunk --- src/game/Transports.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 86d21c9a724..df2ad178550 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -555,11 +555,10 @@ void Transport::Update(uint32 /*p_time*/) //MapManager::Instance().GetMap(m_curr->second.mapid)->Add((GameObject *)this); // -> // ->Add(t); if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0) - sLog.outDetail("%s moved to %f %f %f %d", this->m_name.c_str(), m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); + sLog.outDetail("%s moved to %d %f %f %f %d", this->m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); //Transport Event System CheckForEvent(this->GetEntry(), m_curr->second.id); - sLog.outDetail("%s is at wp id: %u", this->m_name.c_str(), m_curr->second.id); } } -- cgit v1.2.3 From 769c835f266c6e94e878d6e2db0118df1fa7b450 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 5 Mar 2009 15:16:13 -0600 Subject: *Do not allow mage to cast multiple polymorph on different targets. --HG-- branch : trunk --- src/game/SpellMgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 6ab141bba90..c01b3c69ca3 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -751,6 +751,7 @@ bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellI switch(spec1) { case SPELL_JUDGEMENT: + case SPELL_MAGE_POLYMORPH: if(GetSpellSpecific(spellInfo2->Id) == spec1) return true; break; -- cgit v1.2.3