kaos00723
07-01-2010, 03:31 PM
Hi, I can't figure out what I'm doing wrong here. I'm trying to get this chest spawn script installed so that all NPC's up to lvl 50 have a chance of spawning a treasure chest.
sub EVENT_DEATH
{
$rand = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);
if ($npc->GetLevel() >= $ulevel)
{
if ($rand > 9)
{
if ($ulevel < 11)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1250,0,0,$x,$y,$z);
} else {
if ($ulevel < 21)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1251,0,0,$x,$y,$z);
} else {
if ($ulevel < 31)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1252,0,0,$x,$y,$z);
} else {
if ($ulevel < 41)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1253,0,0,$x,$y,$z);
} else {
if ($ulevel < 51)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1254,0,0,$x,$y,$z);
} else {
// We don't support level 51+ characters
}
}
}
} else {
quest::emote(" was worth no treasure this time.");
}
} else {
quest::emote(" is worth no treasure as it is weaker than you.");
}
}
I've tried adding this to the default.pl in the quests directory, the plugins directory, the templates directory, and even individual zones with absolutely no luck. I've tried adding it to the stock default.pl and tried renaming it to default.pl by itself, nothing seems to work.
Can someone please explain to me how to get this to work?
Thanks!
sub EVENT_DEATH
{
$rand = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);
if ($npc->GetLevel() >= $ulevel)
{
if ($rand > 9)
{
if ($ulevel < 11)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1250,0,0,$x,$y,$z);
} else {
if ($ulevel < 21)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1251,0,0,$x,$y,$z);
} else {
if ($ulevel < 31)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1252,0,0,$x,$y,$z);
} else {
if ($ulevel < 41)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1253,0,0,$x,$y,$z);
} else {
if ($ulevel < 51)
{
quest::emote(" was holding extraordinary treasure!");
quest::spawn(1254,0,0,$x,$y,$z);
} else {
// We don't support level 51+ characters
}
}
}
} else {
quest::emote(" was worth no treasure this time.");
}
} else {
quest::emote(" is worth no treasure as it is weaker than you.");
}
}
I've tried adding this to the default.pl in the quests directory, the plugins directory, the templates directory, and even individual zones with absolutely no luck. I've tried adding it to the stock default.pl and tried renaming it to default.pl by itself, nothing seems to work.
Can someone please explain to me how to get this to work?
Thanks!