Jump to content

[patch] Implement Script Command to Send Event to CreatureAI/ InstanceData


Schmoozerd

Recommended Posts

Can be moved to rejected, as implemented ProcessEvent which can be used in most cases where this was thought for

What bug does the patch fix? What features does the patch add?

Implements new Command for Scripts (SCRIPT_COMMAND_SEND_EVENT_TO)

For which repository revision was the patch created?

9941 (requires 9890 I think) - New Version 10155

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

No (new feature)

Who has been writing this patch? Please include either forum user names or email addresses.

me, Schmoozerd

--

This patch is obsolete by now, as long as we don't change the way events are handled seriously :)

--

Description of the new feature

with this feature it is possible, to Send Information from DB-Scripts up to a CreatureAI or ScriptedInstance.

Usally this is useful for Spells with SendEvent - which should do something to an existing creature (which might not be the target of the spell)

Also this can be used to control Instance behaviour from Gossip or similar, because InstanceData::ReceiveEvent has arguments for additionly information

Description of the fields

dataint is used to determine if the information shall be passed to CreatureAI or to InstanceData;

in Case of Creature:

* if in datalong is given an additional entry the script will search in range(datalong3) for the closest creature with entry)

* if not, the script will try to access the target/ source depending on data_flags (0 => target, 1 => source)

might be useful for quest_accept and gossip selects

in Case of InstanceData:

* datalong is the mapId (additional check), datalong2 is the additional transported data

A few examples

* http://www.wowhead.com/spell=23054 There is a Kroshius lying around, so I think this one should react to the Event, and not just having a new one spawned.

* http://www.wowhead.com/spell=16533 This should start a complete Event - So I think the instance-hook is useful

* http://www.wowhead.com/spell=28374 should have effect on the zombies of the Gluth encounter - I think this can be best done via instance_ script.

Patch:

http://paste2.org/p/840944

http://paste2.org/p/906821 - For Rev 10155

http://paste2.org/p/918083 - For Rev 10209 (also corrected small typo in my changes)

http://paste2.org/p/932210 - For Ref 10285 (also added additionalData to CreatureAI::ReceiveEvent)

hope for comments!

Edit: small adjustment, to also get source for ReceiveEvent without using a GridSearcher with data_flags

Test for CreatureAI - Receive Event (Kroshius quest):

http://paste2.org/p/906826

Link to comment
Share on other sites

  • 1 month 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