View Single Post
  #7  
Old 05-02-2017, 08:08 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You can actually do #npcedit setanimation 3 so they spawn feigned. Also, you were missing semi-colons and had an extra comma within your array at the top.

Here's your feigned NPC:
Code:
sub EVENT_SPAWN {
    quest::npcgender(int(rand(2)));
    quest::npcrace(quest::ChooseRandom(1, 4, 6, 7));
    quest::npctexture(quest::ChooseRandom(1, 2));
    quest::wearchange(7, quest::ChooseRandom(1. .3, 7, 8, 14));
}

sub EVENT_SIGNAL {
    if ($signal == 1) {
        quest::signalwith(101109, 2, int(rand(5)));
    }
}

sub EVENT_DEATH {
    quest::signalwith(101109, 3, int(rand(5)));
}
Here's your boss:
Code:
sub EVENT_COMBAT {
    if ($combat_state == 1) {
        quest::say("You won't be the first to desecrate the halls of my ancestors.");
        quest::settimer("dostuff", int(rand(24)) + 1);
        quest::settimer("spawncorpse", 1);
    } else {
        $npc->SetHP($npc->GetMaxHP());
        quest::depopall(101140);
        quest::stoptimer($_) for ("dostuff", "spawncorpse");
    }
}

sub EVENT_DEATH {
    quest::stoptimer("dostuff");
    quest::stoptimer("spawncorpse");
    quest::depopall(101140);
    quest::say("My ancestors will make you pay for this intrusion.");
}

sub EVENT_TIMER {
    if ($timer eq "dostuff") {
        quest::stoptimer("dostuff");
        quest::emote("begins to draw power from his deceased victims.");
        quest::signalwith(101140, 1, 0);#
        signal 1 to adventurercorpse
        for damage increase..if alive they signal back signal 2
        quest::settimer("dostuff", int(rand(24)) + 1);
    } elsif($timer eq "spawncorpse") {
        quest::stoptimer("spawncorpse");
        quest::spawn2(101140, 0, 0, ($x + int(rand(35))), ($y + int(rand(35))), $z, 0);
        quest::settimer("spawncorpse", int(rand(24)) + 1);
    }
}

sub EVENT_SIGNAL {
    if ($signal == 2) {
        quest::modifynpcstat("min_hit", $npc->GetMinDMG() + 10);
        quest::modifynpcstat("max_hit", $npc->GetMaxDMG() + 25);
    } elsif($signal == 3) {
        quest::modifynpcstat("min_hit", $npc->GetMinDMG() - 10);
        quest::modifynpcstat("max_hit", $npc->GetMaxDMG() - 25);
        quest::emote("has lost a portion of his stolen power.");
    }
}
These are completely untested, but give them a try and let me know.


Post-note: You don't have to define a variable for quest::ChooseRandom(), the return type is automatic so you can use it within methods.
Also, "==" is the numeric equality operator, "eq" is the string equality operator. Not that it really matters, but once you get in to more advanced code this may cause some issues (trust me).

Last edited by Kingly_Krab; 05-02-2017 at 08:14 PM..
Reply With Quote