Full Version : Message Gump at Death
xmlspawner >>Q&A >>Message Gump at Death


<< Prev | Next >>

Syntria- 06-03-2006
Greetings,


I am working on a quest and was wondering what the code was to make a monster speak as it dies... I've played with a few things but don't really know what I'm doing yet. Any help would be great!

Thanks.

ArteGordon- 06-03-2006
If you wanted to script it, you would add something like this to the creature script

CODE

 public override bool OnBeforeDeath()
 {
  Say( "I will have my revenge!" );
  return base.OnBeforeDeath();

 }

Syntria- 06-03-2006
Sweet! Thanks hun! That is EXACTLY what I wanted! *continues to make progress*



Hmmm...just out of curiosity. Would there be a way to pull a gump window up to give further quest info? I want a monster to die and give a hint to where their boss is and would want more room than the insta speak.............any ideas?


ArteGordon- 06-03-2006
QUOTE (Syntria @ June 03, 2006 05:34 pm)
Sweet!  Thanks hun!  That is EXACTLY what I wanted!  *continues to make progress*



Hmmm...just out of curiosity.  Would there be a way to pull a gump window up to give further quest info?  I want a monster to die and give a hint to where their boss is and would want more room than the insta speak.............any ideas?

What I do when I want to give out hints like that is to leave notes on the creature that can be looted from their corpse.

a spawn entry like

troll/ADD/<simplenote/notestring/This is where you can add the text that will appear in the note>

would spawn a troll with a note added to its pack that would drop to the corpse on death.

Syntria- 06-03-2006
That's perfect. thank you.

ArteGordon- 06-03-2006
QUOTE (Syntria @ June 03, 2006 04:55 pm)
Greetings,


I am working on a quest and was wondering what the code was to make a monster speak as it dies... I've played with a few things but don't really know what I'm doing yet. Any help would be great!

Thanks.

I liked your idea, and am adding a new attachment called XmlDeathAction that lets you specify any spawner action to be performed when the tagged creature dies.

The actions are the same as any spawner entry or Action field string.

So for example you could open a gump, send a message, spawn another creature, add items to the corpse, etc.

I have also added an example of these types of actions in deathaction.xml in the beta_311.zip

Syntria- 06-03-2006
Very cool! hehe That'll make lots more possiblities as soon as I figure out what I'm doing! lol

ArteGordon- 06-03-2006
With this spawn entry

harpy/ATTACH/<xmldeathaction/action/@GUMP,Harpy be gone,0/Congratulations! You killed a harpy.

killing the harpy gives you this
user posted image

Syntria- 06-04-2006
Just out of curiosity..... How's this goin'? hehe

ArteGordon- 06-04-2006
QUOTE (Syntria @ June 04, 2006 05:25 pm)
Just out of curiosity..... How's this goin'? hehe

I have already added it to the beta_311.zip, so it is basically done.

Syntria- 06-04-2006
Sweet... *impatiently sits on hands and waits*

ArteGordon- 06-04-2006
QUOTE (Syntria @ June 04, 2006 07:10 pm)
Sweet...  *impatiently sits on hands and waits*

you can try it out if you like. The beta_311.zip file is here.
http://xmlspawner.15.forumer.com/index.php?showtopic=53

It has all of the files that will be changed in the next update so far.

Syntria- 06-04-2006
This works great! I'm still tryin' to piece together the rest of the code for XMLSpawner2 but I seem to have gotten this down.... I'm glad that you decided to do this!! Thank you!