Jump to content

Modifying SCRIPT_COMMAND_TEMP_SUMMON_CREATURE


terrorio

Recommended Posts

Hello all,

Got a question that I can't answer myself.

I want to modify the parameters of command SCRIPT_COMMAND_TEMP_SUMMON_CREATURE = 10. (Located in map.cpp)

Currently the 'datalong3' and 'datalong4' aren't used in the database table 'quest_end_scripts' (at least not for the above command).

How can I make datalong3 to hold the parameter of TempSummonType?

Currently it is like this:

Creature* pCreature = summoner->SummonCreature(step.script->summonCreature.creatureEntry, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->summonCreature.despawnDelay, (step.script->summonCreature.flags & 0x01) ? true: false);

At the moment it's a fixed value: TEMPSUMMON_TIMED_OR_DEAD_DESPAWN.

But I want it like this, so I can put the value of TempSummonType in my database:

Creature* pCreature = summoner->SummonCreature(step.script->summonCreature.creatureEntry, x, y, z, o, step.script->summonCreature.unused1, step.script->summonCreature.despawnDelay, (step.script->summonCreature.flags & 0x01) ? true: false);

unused1 seems to be the 5th row in 'quest_end_scripts' (datalong3)

But this doesn't work and I've tried several things but nothing works.

Can ayone give some help?

Link to comment
Share on other sites

look in the declaration (i think in script-mgr)

the actual data of the script is a union of sub-structs (one for each command) and the common values

hence you just must add there the default values.

However I think I don't really think this is a good choice, most temp-summoned npcs should be TEMPSUMMON_DEAD_DESPAWN or TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, but if you want to change it you are ofc free to do so ;)

Best look into one of the recent commits which added a new command to see which places you might want to change

Link to comment
Share on other sites

Thanks for the quick answer, I'll see if I can get further with this tomorrow, kinda late now :D .

The reason I wanted to change is because whenever I summon a creature via the quest_end_scripts, it never stayed longer than 6/7 seconds.

I tried every number at the 'datalong2' 120, 7200, 7200000, 100000. It didn't matter, it despawned everytime after 6/7 seconds. (I'm on Zero btw).

When I used TempSummonType 8 (TEMPSUMMON_MANUAL_DESPAWN) it stayed forever untill I despawn it through a script, which is what I need.

Anyway, I'll continue with this tomorrow, g'night!

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