PDA

View Full Version : Client Force-Cast


Monrezz
02-14-2004, 02:23 PM
Is there a function for quest:: that forces a client to cast a spell? I'm sure I read about it somewhere, can't remember where though.

I would like an NPC to force the client to cast a group spell - quest::castspell($userid,spellid) currently only buffs the NPC.

Monrezz

samandhi
02-14-2004, 03:07 PM
How about just this? :
castspell("$userid","spellid")

Maybe use it in an EVENT_SAY{ routine.....

Maybe used something like this:
EVENT_SAY{

if ($1-=~ "jerk")

{

say("You should not have done that!")

castspell("$userid","nukespell")

say("Now it appears you have learned not to do that.")

}
}
Though This is for .qst format (Im still learning hehe).

You DID see the sticky in this forum?! maybe try the command test script that came from Lurker005's post and that Eglin wrote..

sub EVENT_SAY() {
quest::say("Greetings. $name... I can tell you about [variables] and [commands] or you can give me items.") if ($text=~/hail/i);
quest::say("Want to test a variable? Try [name]. [race]. [class]. [userid]. [ulevel]. [uguildid]. [mobid]. [mlevel]. [faction]. [zonesn]. [zoneln]. or [status]") if ($text=~/variabl/i);
quest::say("name = $name") if($text=~/name/i);
quest::say("race = $race") if($text=~/race/i);
quest::say("class = $class") if($text=~/class/i);
quest::say("userid = $userid") if($text=~/userid/i);
quest::say("ulevel = $ulevel") if($text=~/ulevel/i);
quest::say("uguildid = $uguildid") if($text=~/uguildid/i);
quest::say("mobid = $mobid") if($text=~/mobid/i);
quest::say("mlevel = $mlevel") if($text=~/mlevel/i);
quest::say("faction = $faction") if($text=~/faction/i);
quest::say("zonesn = $zonesn") if($text=~/zonesn/i);
quest::say("zoneln = $zoneln") if($text=~/zoneln/i);
quest::say("status = $status") if($text=~/status/i);
quest::say("Want to test a command? Try [emote]. [shout]. [spawn]. [echo]. [summonitem]. [castspell]. [depop]. [cumflag]. [flagnpc]. [flagclient].[exp]. [level]. [safemove]. [rain]. [snow]. [givecash]. [pvp]. [doanim]. [addskill]. or [me]") if($text=~/command/i);
quest::emote("emotes before you.") if ($text=~/emote/i);
quest::shout("Is this shouting?") if ($text=~/shout/i);
quest::say("I don't feel like spawning anything right now") if($text=~/spawn/i);
quest::echo("this is an echo echo echo echo echo") if ($text=~/echo/i);
quest::summonitem(17969) if ($text=~/summonitem/i);
quest::castspell(278, $id) if ($text=~/castspell/i);
quest::say("awww... I don't wanna!") if ($text=~/depop/i);
quest::exp(100) if ($text=~/exp/i);
quest::level($ulevel + 1) if ($text=~/level/i);
quest::safemove() if ($text=~/safemove/i);
quest::rain(1) if ($text=~/rain/i);
quest::snow(1) if ($text=~/snow/i);
quest::givecash(0,0,0,50) if ($text=~/givecash/i);
quest::pvp("on") if ($text=~/pvp/i);
quest::doanim(3) if ($text=~/doanim/i);
quest::me("The heavens applaud you.") if ($text=~/me/i);
}

Monrezz
02-15-2004, 12:54 AM
castspell("$userid","spellid")
Tried, doesn't work.

Though This is for .qst format (Im still learning hehe).

Sorry, using Perl. It's not that hard to learn - very similar to the qst format except you need to remember quest:: and ;.

You DID see the sticky in this forum?!
Yes, but as you can see the only command there for casting is quest::castspell - which doesn't work. Also, there are a few new functions in that posts could do with being updated :)

Monrezz

Scorpious2k
02-15-2004, 02:53 AM
I'm not sure if its out in cvs yet (I think t is - check parser.cpp source) but quest::selfcast("spellid"); I think is what you want.

It causes a spell to be cast on the target - probably for those spells where the target can only be self and can't be cast on others. If you use quest::castspell with those, it causes he spell to be cast on the NPC as I recall.

Monrezz
02-15-2004, 03:11 AM
That's the one - thanks Scorp :)

Lurker_005
02-15-2004, 04:37 PM
Also, there are a few new functions in that posts could do with being updated :)

Yea I know :( I have been pretty busy lately and havn't had much time to review what has made it into the CVS.

Monrezz
02-16-2004, 05:33 AM
Nevermind, did it myself :)

http://www.eqemulator.net/forums/viewtopic.php?t=12020