Jump to content

Unit::_UpdateSpells( update_diff ); in CORPSE DeathState


Guest breakwater

Recommended Posts

Hi,

I need a UpdateSpells in dead creatures

@@ -487,10 +487,11 @@ void Creature::Update(uint32 update_diff, uint32 diff)
            }
            break;
        }
        case CORPSE:
        {
+            Unit::_UpdateSpells( update_diff );
            if (m_isDeadByDefault)
                break;

            if (m_corpseDecayTimer <= update_diff)
            {

because i will fix the spell Corpse Explode with this Part of Code

@@ -5209,10 +5209,27 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
    bool loading = (target->GetTypeId() == TYPEID_PLAYER && ((Player*)target)->GetSession()->PlayerLoading());

    SpellEntry const*spell = GetSpellProto();
    switch( spell->SpellFamilyName)
    {
+        case SPELLFAMILY_GENERIC:
+        {
+            Unit* caster = GetCaster();
+            if(!apply)
+            {
+                switch(spell->Id)
+                {
+                    case 49555:
+                        caster->CastSpell(target,49618,true);
+                        break;
+                    case 59807:
+                        caster->CastSpell(target,59809,true);
+                        break;
+                }
+            }
+            break;
+        }
        case SPELLFAMILY_ROGUE:
        {
            if(!apply)
            {
                switch(spell->Id)

Why this function is not in the creature update, i think it is realy useful? Is it dangerous? It reduces the speed from server too much?

I hope someone can tell me

Sry for my bad english

Link to comment
Share on other sites

u sure the creature is really dead? or just "feigning death"?

In my opinion is the creature really dead. Because the Spell has a Spell_script_target and i have only the choice in DB between alive creatures and realy dead creature. If I change in DB to alive creature, the spell goes maybe on really alive creatures. We have no favoritism between alive and "feigning death" creatures.

It is bad to Update the Auras for dead creatures?

Link to comment
Share on other sites

  • 10 months later...

Pretty sure this was fixed in 11818

[11818] update creature's unit part(update spell events, auras, movem…

…ent) while in death. thanks to rsa for making tests

this allows us update creature's death persistent auras, fall died creatures in natural, non hacky way

also fix the bug that creature starts waypoint movement not from begining at respawning. thanks to Grz3s for reporting

Thank you anyways ;)

Edit: Just saw that there are two spell fixes also in your patch, can you give some comments about them please?

Link to comment
Share on other sites

my actual code

The original cast is important, because of faction between trollgore and creatures. Trollgore should make damage

http://paste2.org/p/1801801

I think that's unnecessary:

target->SetDeathState(JUST_DIED);

because creature is dead. Maybe a long time ago, this spell works with fake death creatures

Hope thats help

PS: Code is to old for a good patch-file

Link to comment
Share on other sites

  • 4 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use