|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |
 |
|
 |

11-07-2012, 07:45 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
First, I am not sure if your HP event 100 would do anything, though I would need to test to verify that. I think you would need to start at 99 or so for it to trigger. Next, when you reset the event and set the HPs, you also need to set the HP event back to the one you want to trigger first again with "quest::setnexthpevent(xxx)". Also, it looks like you are checking if "$combat_state = 1", which is wrong for 2 reasons. To do a comparison, you need to use == not =, and you should be checking for combat state 0, not 1, as 1 is for when combat is started and 0 is for ended. Last, timers are pretty simple, you just need to set the timer in your EVENT_COMBAT where you set the HPs back to 100%. Then, check the timer in EVENT_TIMER and do a depop. There are lots of timer examples on the forums, and explanations in the wiki if you need help with that. Otherwise, post what you have for timers so far and we can tell you what you are doing wrong.
Last edited by trevius; 11-07-2012 at 07:56 AM..
|
 |
|
 |
 |
|
 |

11-07-2012, 12:40 PM
|
Sarnak
|
|
Join Date: May 2008
Location: california
Posts: 45
|
|
Well, as it was up, it was working fine at hpevent(100), but I changed it anyway to 95.
As for the 2 mistakes.. yeah, I really don't know how I got turned around in there.. I had changed that portion of the code about 20 times using timers, I must have missed them both (rest of code uses == like it should =P )
I read a few examples, as well as the wiki regarding timers.. And I know I had them figured out and working last time I was messing around with scripting, but it seems I've drank too much in the past year maybe? =P But, after using a few examples here on the forums, I threw this together real quick (and yet, I don't really see any mistakes), but it doesn't work.. (short timer for easy testing)
Code:
sub EVENT_SPAWN
{
quest::shout("Foolish mortals! You should not have awoken me from my slumber!");
quest::settimer("depop",10);
quest::setnexthpevent(95);
}
sub EVENT_COMBAT
{
if ($combat_state == 0)
{
quest::settimer("depop",10);
$npc->SetHP(4500);
}
if ($combat_state == 1)
{
quest::stoptimer("depop");
}
}
sub EVENT_TIMER
{
if ($timer eq "depop")
{
quest::depopall(11253);
quest::depopall(11254);
quest::depopall(11255);
quest::depopall(11210);
}
}
sub EVENT_HP
{
if($hpevent == 95)
{
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::setnexthpevent(75);
}
if($hpevent == 75)
{
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
$npc->SetHP(4275);
quest::setnexthpevent(50);
}
if($hpevent == 50)
{
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
$npc->SetHP(3375);
quest::setnexthpevent(25);
}
if($hpevent == 25)
{
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::spawn2(111254,0,0,"202.1","357","-24.2","128");
quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
quest::spawn2(111255,0,0,"202.1","357","-24.2","128");
$npc->SetHP(2250);
quest::setnexthpevent(0);
}
if($hpevent == 0)
{
quest::shout("Impossible!");
quest::depopall(111253);
quest::depopall(111254);
quest::depopall(111255);
}
}
sub EVENT_SLAY
{
quest::shout("Soandso will be pleased with your death! I shall feast on your corpse!");
quest::spawn2(111253,0,0,"202.1","357","-24.2","128");
}
sub EVENT_DEATH
{
quest::shout("Impossible!");
quest::depopall(111253);
quest::depopall(111254);
quest::depopall(111255);
}
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:33 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |