Shin Noir
10-16-2009, 05:06 PM
This is old code of mine when I first started up EQEMU questing, but instead of it potentially getting deleted or lost in limbo of other projects, I figured I'd post it for others to see. Originally written on 7/12/09.
It isn't complete. It needed a few tweaks to properly get working
The general idea was, you talked to Derron_Coldmist in Crystal Caverns and he would give you a task to defend him. He also started an event where orcs would begin roaming to him, intent on killing him. If he died, you failed the task. Each time an orc died during this event, he would give you a bounty point that allowed you to spawn archers to help assist in fending off the attacks.
So essentially:
Derron_Coldmist - your life
Archers: your towers
Orcs: Creeps
I didn't know how qglobals worked back then, so I was using just temp vars.
Here's the code. Originally built on crystal\Derron_Coldmist.pl
sub EVENT_SAY {
if ($text=~/hail/i) {
#quest::say("Yes, hello");
#quest::spawn2(999144, 0, 0, 184.5, -55.6, -376.7, 86.5);
quest::spawn2(999144, 0, 0, 219.1, -53.7, -376.7, 130.1);
quest::say("$orcslays killed");
}
if ($text=~/archer/i) {
if (!defined($entity_list->GetMobByNpcTypeID(999145))) {
$tmpname = 999145;
quest::spawn2($tmpname, 0, 0, 200.4, -226.7, -382.7, 27.3);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #1 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999146))) {
$tmpname = 999146;
quest::spawn2($tmpname, 0, 0, 221.8, -227.5, -382.7, 0.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #2 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999147))) {
$tmpname = 999147;
quest::spawn2($tmpname, 0, 0, 198.8, -246.5, -382.7, 19.6);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #3 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999148))) {
$tmpname = 999148;
quest::spawn2($tmpname, 0, 0, 210.1, -245.2, -380.2, 8.8);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #4 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999149))) {
$tmpname = 999149;
quest::spawn2($tmpname, 0, 0, 220.7, -246.5, -382.7, 254.8);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #5 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999150))) {
$tmpname = 999150;
quest::spawn2($tmpname, 0, 0, 192.9, -259.9, -382.7, 18.6);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #6 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999151))) {
$tmpname = 999151;
quest::spawn2($tmpname, 0, 0, 215.2, -263.6, -382.7, 1.9);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #7 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999152))) {
$tmpname = 999152;
quest::spawn2($tmpname, 0, 0, 203.1, -299.6, -382.7, 7.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #8 reporting for duty!"); #back row guy.
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999153))) {
$tmpname = 999153;
quest::spawn2($tmpname, 0, 0, 191.3, -279.4, -382.7, 15.1);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #9 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999154))) {
$tmpname = 999154;
quest::spawn2($tmpname, 0, 0, 214.3, -275.6, -382.7, 0.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #10 reporting for duty!");
}
else {
quest::say("You have already the maximum amount of guards.");
}
}
}
sub EVENT_SIGNAL {
#quest::ze(15, "Orc Dead Rec'd.");
if (!defined($orcslays)) {
$orcslays = 0;
}
$orcslays++;
$orcmoney++;
quest::say("$orcslays orcs have been killed!");
}
Then you had crystal/a_Ry-Gorr_invader.pl
# # 999144 a_Ry`Gorr_invader used on Derron Coldmists's custom quest.
sub EVENT_SPAWN {
#quest::attacknpctype(
quest::moveto(206, -321, -383);
#
#sethate
}
sub EVENT_SLAY {
quest::moveto(206, -321, -383);
}
sub EVENT_NPC_SLAY {
quest::moveto(206, -321, -383);
}
sub EVENT_COMBAT {
if ($combat_state==0) {
quest::moveto(206, -321, -383);
}
}
sub EVENT_DEATH {
quest::signal(121024);
}
Sadly I don't have these mobs anymore, but they wouldn't be hard to recreate.
It isn't complete. It needed a few tweaks to properly get working
The general idea was, you talked to Derron_Coldmist in Crystal Caverns and he would give you a task to defend him. He also started an event where orcs would begin roaming to him, intent on killing him. If he died, you failed the task. Each time an orc died during this event, he would give you a bounty point that allowed you to spawn archers to help assist in fending off the attacks.
So essentially:
Derron_Coldmist - your life
Archers: your towers
Orcs: Creeps
I didn't know how qglobals worked back then, so I was using just temp vars.
Here's the code. Originally built on crystal\Derron_Coldmist.pl
sub EVENT_SAY {
if ($text=~/hail/i) {
#quest::say("Yes, hello");
#quest::spawn2(999144, 0, 0, 184.5, -55.6, -376.7, 86.5);
quest::spawn2(999144, 0, 0, 219.1, -53.7, -376.7, 130.1);
quest::say("$orcslays killed");
}
if ($text=~/archer/i) {
if (!defined($entity_list->GetMobByNpcTypeID(999145))) {
$tmpname = 999145;
quest::spawn2($tmpname, 0, 0, 200.4, -226.7, -382.7, 27.3);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #1 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999146))) {
$tmpname = 999146;
quest::spawn2($tmpname, 0, 0, 221.8, -227.5, -382.7, 0.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #2 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999147))) {
$tmpname = 999147;
quest::spawn2($tmpname, 0, 0, 198.8, -246.5, -382.7, 19.6);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #3 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999148))) {
$tmpname = 999148;
quest::spawn2($tmpname, 0, 0, 210.1, -245.2, -380.2, 8.8);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #4 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999149))) {
$tmpname = 999149;
quest::spawn2($tmpname, 0, 0, 220.7, -246.5, -382.7, 254.8);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #5 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999150))) {
$tmpname = 999150;
quest::spawn2($tmpname, 0, 0, 192.9, -259.9, -382.7, 18.6);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #6 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999151))) {
$tmpname = 999151;
quest::spawn2($tmpname, 0, 0, 215.2, -263.6, -382.7, 1.9);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #7 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999152))) {
$tmpname = 999152;
quest::spawn2($tmpname, 0, 0, 203.1, -299.6, -382.7, 7.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #8 reporting for duty!"); #back row guy.
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999153))) {
$tmpname = 999153;
quest::spawn2($tmpname, 0, 0, 191.3, -279.4, -382.7, 15.1);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #9 reporting for duty!");
}
elsif (!defined($entity_list->GetMobByNpcTypeID(999154))) {
$tmpname = 999154;
quest::spawn2($tmpname, 0, 0, 214.3, -275.6, -382.7, 0.0);
$entity_list->GetMobByNpcTypeID($tmpname)->Stun(2.0); #They're stunned for 2 secs.
$entity_list->GetMobByNpcTypeID($tmpname)->Say("Archer #10 reporting for duty!");
}
else {
quest::say("You have already the maximum amount of guards.");
}
}
}
sub EVENT_SIGNAL {
#quest::ze(15, "Orc Dead Rec'd.");
if (!defined($orcslays)) {
$orcslays = 0;
}
$orcslays++;
$orcmoney++;
quest::say("$orcslays orcs have been killed!");
}
Then you had crystal/a_Ry-Gorr_invader.pl
# # 999144 a_Ry`Gorr_invader used on Derron Coldmists's custom quest.
sub EVENT_SPAWN {
#quest::attacknpctype(
quest::moveto(206, -321, -383);
#
#sethate
}
sub EVENT_SLAY {
quest::moveto(206, -321, -383);
}
sub EVENT_NPC_SLAY {
quest::moveto(206, -321, -383);
}
sub EVENT_COMBAT {
if ($combat_state==0) {
quest::moveto(206, -321, -383);
}
}
sub EVENT_DEATH {
quest::signal(121024);
}
Sadly I don't have these mobs anymore, but they wouldn't be hard to recreate.