View Full Version : Mob wont cast. Please help!
Reynin89
05-03-2010, 04:41 PM
Hey everyone me and my friend just got back into eqemu and made our server. We used to have great scripts but lost them and cant remember anything lol. Can someone please help me with making this cast a spell?
sub EVENT_COMBAT
{
if ($combat_state == 1)
{
quest::settimer("timer", 1);
quest::shout("test test test");
}
}
sub EVENT_TIMER
{
if ($timer eq "timer")
{
quest::cast($userid,131);
}
}
and so like after u wipe or sumthing or lose aggro the spell will stop casting. As of right now the only thing this mob is doing is shouting "test test test" as I said we used to do it all the time with sub EVENT_TIMER just cant rememeber how. a quick explination would prolly bring it back to us.
Thanks in advance.
Reynin89
05-03-2010, 08:30 PM
anyone that could help me on this please?
joligario
05-03-2010, 08:45 PM
You don't have to remember all the code. The wiki is pretty comprehensive. http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial Another good resource is pre-existing code. There are several events already written that cast spells on regular intervals and reset on a wipe. You can check out PEQ's quests for examples.
If you are trying to use the client as a target, you need to remember that the client does not trigger the timer event, so it won't be automatically available to that sub.
Reynin89
05-03-2010, 08:58 PM
hm ok. where can i look at PEQs quests?
joligario
05-03-2010, 09:07 PM
Here is the svn: http://code.google.com/p/projecteqquests/
Reynin89
05-03-2010, 09:23 PM
Hm u sent me the link to a rev download?
Reynin89
05-03-2010, 09:58 PM
i still cant find anything to make this dang mob cast.. anyone got any suggestions please?
Andrew80k
05-03-2010, 10:25 PM
Hm u sent me the link to a rev download?
The link goes to the svn. Click on the source tab and then on the browse link, then the trunk and keep drilling down. I can't think of a quest offhand that will do what you require, but if you have your own server, surely you've downloaded the quests from somewhere. Just do a search of the quest directory looking for the quest::cast key word and you'll get tons of hits. Poke around until you find one that is similar enough to what you are trying to do and use that.
Reynin89
05-03-2010, 10:45 PM
hm that works how exactly do i search my quest directory specifically?
Andrew80k
05-03-2010, 11:18 PM
Windows? or Linux?
Windows(XP), bring up a File Explorer window, navigate to your emu folder, where the quests are, then click on search. Click on files and folders, find the text box that says find IN files and enter quest::cast. Click find or whatever.
Unix: Let me know and I'll add directions.
Reynin89
05-03-2010, 11:30 PM
ahhh ok im using windows 7 ill try it thanks
Reynin89
05-03-2010, 11:53 PM
nope cant do that with 7. wow lol still messin with this dam thing
Reynin89
05-04-2010, 12:21 AM
Messing around with another script while i look at that svn link i got I figured out how to make this mob cast on ITSELF but no on the player.. So its nuking itself lol ANY IDEAS?!?!
sub EVENT_COMBAT {
if ($combat_state == 1) {
quest::setnexthpevent(95);
quest::shout ("test test test");
}
}
sub EVENT_HP
{
if($hpevent == 95)
{
quest::shout ("HELP HELP HELP");
quest::castspell($userid,477); }
}
im to the point now i just want it to cast anything on a player thats attacking it.
Reynin89
05-04-2010, 12:31 AM
if i use
quest::castspell(477,$mobid);
itll cast on itself but if i use ($userid,477) or (477,$userid) it wont cast on the player, how does that make sense. Theres gotta be SOMETHING im missing?
Andrew80k
05-04-2010, 12:54 AM
should be quest::castspell($userid,<spell#>) so that should be working. Did you try it without the EVENT_HP?
if ($combat_state == 1) {
quest::castspell($userid,477);
}
Reynin89
05-04-2010, 12:57 AM
yes ive tried that to. Thats why im so oblivious as to WHY this is not casting any spells?
Reynin89
05-04-2010, 12:58 AM
its like $userid isnt working at all or something
Reynin89
05-04-2010, 01:07 AM
WOW I finally got this afters hours on end of looking up random scripts trying commands ugh! If ANYONE has the same problem with $userid heres what I did to get it to work. sub EVENT_COMBAT {
if ($combat_state == 1) {
quest::setnexthpevent(95);
quest::shout ("test test test");
}
}
sub EVENT_HP
{
if($hpevent == 95)
{
quest::shout ("HELP HELP HELP");
quest::castspell(5451,$targetid); }
}
seems (spellid,$targetid) did the trick. Thanks for everyones help.
Frosef
05-04-2010, 08:25 PM
Does $userid actually work in this case? It seems to me that such an event wouldn't have a client "user" to trigger them, so $userid might be null?
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.