EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   EVENT_CAST_ON : Missing chunk of code (https://www.eqemulator.org/forums/showthread.php?t=25288)

Bulle 05-20-2008 04:20 PM

EVENT_CAST_ON : Missing chunk of code
 
When EVEN_CAST_ON has been added a portion of the code has not been integrated, the one passing the "spell_id" to the Perl script :

Version 1108 :
Code:

                case EVENT_ZONE:{
                        ExportVar(packagename.c_str(), "target_zone_id", data);
                        break;
                }

                //nothing special about these events
                case EVENT_DEATH:
                case EVENT_SPAWN:
                case EVENT_ATTACK:
                case EVENT_SLAY:
                case EVENT_AGGRO:
                case EVENT_ENTER:
                case EVENT_EXIT:
                case EVENT_ENTERZONE:
                case EVENT_LEVEL_UP:
                case EVENT_KILLED_MERIT:
                case EVENT_CAST_ON:
                        break;

"My" version (as it was proposed) :
Code:

                case EVENT_ZONE:{
                        ExportVar(packagename.c_str(), "target_zone_id", data);
                        break;
                }

                case EVENT_CAST_ON:{
                        ExportVar(packagename.c_str(), "spell_id", data);
                        break;
                }

                //nothing special about these events
                case EVENT_DEATH:
                case EVENT_SPAWN:
                case EVENT_ATTACK:
                case EVENT_SLAY:
                case EVENT_AGGRO:
                case EVENT_ENTER:
                case EVENT_EXIT:
                case EVENT_ENTERZONE:
                case EVENT_LEVEL_UP:               
                case EVENT_KILLED_MERIT:               
                        break;

Adding this change allows checking the spell ID cast on the NPC from the Perl script, a valuable information. Can this change be done by a developer ?

KLS 05-20-2008 04:44 PM

I already fixed it locally, it got missed on the merge or something initially I dunno.

thepoetwarrior 05-21-2008 11:01 AM

How's this work? If an NPC is casted on with a spell by a player? Im assuming it returns which spell was used, such as if the mob was rooted etc. Does the type of spell matter, dec or benifit? Could be useful in quest.

Bulle 05-21-2008 01:27 PM

It triggers the event, and in $spell_id (in Perl) you get the ID of the spell the NPC has been hit with. If you need more info about the spell you have to query for it (dunno if/how it can be done from Perl, possibly). The event is fired whether or not the NPC resists, is immune etc. It means the Spell is on the target.

Here is how you will be able to use it once KLS commits the missing part, to update a quest globals when a specific NPC is hit by a Courage (context : a cleric guildmaster quested the player with buffing this guard, the event sets the globals, and the NPC checks the globals before rewarding the PC for his action :
Code:

sub EVENT_CAST_ON
{
  if($spell_id == 202)  # Courage
  {
    quest::say("Bzzzzt !");
    quest::setglobal("A_Bit_of_Clericing", "Guard Buffed", 5, "F");
  }
}



All times are GMT -4. The time now is 05:14 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.