EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Little help with player casting detection (https://www.eqemulator.org/forums/showthread.php?t=28524)

ChaosSlayerZ 06-09-2009 05:49 PM

Little help with player casting detection
 
I like to write a player.pl script which would see if player has casted a specific spell.
If player did, the script will check what gender player is, and if male put one illusion on the player, if female put a diffirent illusion on the player.

Any sugestions? =)

PS I have looked at Trev's Illusions script

http://www.eqemulator.net/forums/showthread.php?t=25556

but the script operates of NPC who detects proximity.
I need kind of a trigger which would fire based on players themselves.

trevius 06-09-2009 06:27 PM

Though I haven't tried it yet, you should be able to use the new EVENT_CAST for that. It should be something as simple as this:

player.pl
Code:

sub EVENT_CAST {

  if($spell_id == 1000) {

    if($gender == 0) {
      quest::playerrace(95);
    }
    elsif($gender == 1) {
      quest::playerrace(62);
    }
    else{
      # do nothing
    }

  }

}

As I said, I haven't tested this new event yet, but I think this should do exactly what you are wanting. I have been wanting to write some new scripts to use it and test it out, but just haven't had time yet. I am excited to have this as an option now and will definitely be taking advantage of it some time soon :)

ChaosSlayerZ 06-09-2009 06:34 PM

Ah perfect! I rememebered you offered this a while back but I had no idea it was actualy put in. Which Rev it went in?

trevius 06-09-2009 09:47 PM

Realityincarnate added it in R605.

ChaosSlayerZ 06-10-2009 12:59 AM

Trev, perhaps you could help me with something related

Let say that I want to change race/put illusion on a pet when it spawns liek it was recently done for POSKY, but I want to do this for NPC pets.

Will

sub EVENT_SPAWN
{
quest::npcrace(69);
quest::npctexture(1);
quest::npcsize(4);
}

work for npc controlled pets?

If does I have even tricker question.
I ONLY want to alter race of a pet IF the NPC who summoned it belongs to specific race/class himself.

Can this be done?
Thanks! =)

trevius 06-10-2009 05:15 AM

Unless it was finally changed, NPCs still cannot be set to change their race when they spawn. It has to be at least 1 second after they spawn, so you have to start a timer for 1 second when they spawn and have the timer change their race/etc.

As for the thing about the owner's race, I haven't really messed with that stuff much, but Kayen definitely has, lol. I know that quest objects for getting the pet or the pet's owner work, but I don't have any good examples to give you offhand.

Dibalamin 06-10-2009 08:01 AM

I'm pretty sure Congdar fixed this for at least PC pets (PoSky pets I think encouraged the change), I'm not familiar enough with the source to know if this will affect NPC pets as well.


All times are GMT -4. The time now is 04:40 PM.

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