Aller au contenu

Photo

(I Solved it) Short duration pets


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
jsd313

jsd313
  • Members
  • 184 messages
I am working on adding a few pets to my mod but I want them to be temporary and without a master. I have it set now that I can spawn the pet but I can't get him to despawn after a set duration. I have set it up before so it was a modal ability and I was able to set a duration there but the pet had a master.

Like in other games that have short duration swarm pets I want the caster to have a single target spell to call a creature to fight as an ally not part of the party or listed as a pet.

I have tried many variations of code and everything, been working on this for about 16 hours total now lol.

Here is where I am currently with the below code part of my spell_singletarget script. It is set up in abi_base properly and it works, it summons the creature and he fights alongside the party. He uses the custom tactics and abilities I set for him. I just don't know how to make him go away after 30 or 45 seconds.

Any help here would be huge and greatly apprecaited.

[dascript]
case ABILITY_SPELL_WAKE_THE_DEAD:
        {
            CreateObject( OBJECT_TYPE_CREATURE, R"skeleton.utc", GetSafeLocation( GetLocation( stEvent.oCaster )) );
                       break;
        }
[/dascript]

Modifié par jsd313, 03 avril 2010 - 08:47 .


#2
jsd313

jsd313
  • Members
  • 184 messages
This works perfectly, not sure how clean it is but it works :)

[dascript]
case ABILITY_SPELL_WAKE_THE_DEAD:
        {
           
            SetTag( CreateObject( OBJECT_TYPE_CREATURE, R"skeleton.utc", GetSafeLocation( GetLocation( stEvent.oCaster )) ), "skeleton_rog" );
            object oSkeleton = GetObjectByTag("skeleton_rog", 0);
            if (IsObjectValid(oSkeleton))
        {
            DestroyObject(oSkeleton, 30000);
        }
            break;
        }
[/dascript]