Jump to content

looking for function to summon temp object


antiroot

Recommended Posts

I'm taking my first swing at scripting (nothing offy like but just for learning) I'm trying to create an item with a script effect that will summon an object, however looking at the core i can only find SummonCreature is there not a function that does the same but for game objects?

Edit: I should note I want this to be a temporary summon with despawn time

Another Edit: I think I found what i'm looking for, (i removed most args to keep it short)

bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, ....)

I just want to make sure I don't save it to the DB, and use it the way it is used in SpellEffects.cpp

So now I just want to know if my assumptions are correct

Edit again: Ha so i'm just confusing my self more and more, I think should be using DynamicObject::Create(...)

Link to comment
Share on other sites

Yes, either it should be spawned by a spell, or always spawn in the same place in which case you can put it in the DB in a despawned state and spawn it through the script. Summoning objects anywhere without a spell never happens on retail so it isn't present in mangos.

Link to comment
Share on other sites

Ok thanks to both of you

I did see the Lava Bomb related code but also noticed the // Hack alert! and was just hoping there was a more proper way to do it. What i'm wanting to make is not official like at all, and is NOT something that I would try to have added to core or sd2. Just wanted a little learning experience with scripting, and the parts about creating a script, adding reference to it in db and actually seeing it in action that's what I want to learn about

But again thanks for pointing me in the right/hacky direction, I'll probably just summon a temp creature to avoid using something that is not correct since this is just for learning and i don't want to get into a habit of doing something wrong

Link to comment
Share on other sites

×
×
  • 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