summaryrefslogtreecommitdiff
path: root/npc/020-7-1
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-25 23:54:59 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-25 23:54:59 -0300
commit29952d7943a21de3802970d317b22641ac861d91 (patch)
tree997d2a0e91d9a9beb07ad6979cf9e571e2645785 /npc/020-7-1
parent4b2c057fc2cea88047d3356da3345f8f69a02fff (diff)
downloadserverdata-29952d7943a21de3802970d317b22641ac861d91.tar.gz
serverdata-29952d7943a21de3802970d317b22641ac861d91.tar.bz2
serverdata-29952d7943a21de3802970d317b22641ac861d91.tar.xz
serverdata-29952d7943a21de3802970d317b22641ac861d91.zip
Pyry is working nicely now
Diffstat (limited to 'npc/020-7-1')
-rw-r--r--npc/020-7-1/core.txt64
1 files changed, 46 insertions, 18 deletions
diff --git a/npc/020-7-1/core.txt b/npc/020-7-1/core.txt
index 02ed4e812..015b23ffa 100644
--- a/npc/020-7-1/core.txt
+++ b/npc/020-7-1/core.txt
@@ -188,21 +188,23 @@ function script BSProccess {
if (getd("$@BS_NEST"+str(.@id)))
return;
- // Let's see if something should happen
+ // Let's see if something should happen (16.7% odds each second. 3% of drip)
.@chance=rand(30);
- if (.@chance <= 16) {
+ if (.@chance <= 25) {
return;
} else if (.@chance == 27) {
dispbottom l("A slime drips in front of you and explodes!");
percentheal -40, 0;
+ } else {
+ dispbottom l("You notice a group of slimes emerging from the debris among the shelves.");
}
// If it haven't returned yet: It's good to go!
// Reserve the nest ID for us, and clear the previous.
BSClearNest(@nestid);
+ BSClearNest(.@nest);
@nestid=.@nest;
- BSClearNest(@nestid);
- setd(getd("$@BS_NEST"+.@id), getcharid(0));
+ setd("$@BS_NEST"+.@id, getcharid(0));
// We spawn monsters
if (.@id % 4 == 0)
@@ -210,10 +212,9 @@ function script BSProccess {
else
.@mid=BlueSlime;
- // Does getd() works against a constant?
- areamonster .@m$, .@xc-2, .@yc-2, .@xc+2, .@yc+2, "", .@mid, getd("BS_KNEST"+.@id), "#BlueSageHUB::OnSlimeKill"+.@id;
-
- dispbottom l("You notice a group of slimes emerging from the debris among the shelves.");
+ //debugmes "Spawning %d slimes on quadrand %d", getd("$@BS_KNEST"+.@id), .@id;
+ // Does getd() works against a constant? I don't think so
+ monster .@m$, .@xc, .@yc, strcharinfo(0)+"'s slime", .@mid, getd("$@BS_KNEST"+.@id), "#BlueSageHUB::OnSlimeKill"+.@id;
return;
}
@@ -225,14 +226,25 @@ function script BSProccessDeath {
.@ammo=getarg(1);
.@id=BSQuadrand(.@nest);
+ // First and foremost: Drops
+ if (playerattached()) {
+ getmapxy(.@m$, .@x, .@y, 0);
+ // Capped at ~12% drop chance of book pages
+ if (rand(0,10000) <= 560+(readparam(bLuck)*7))
+ makeitem SpellBookPage, 1, .@m$, .@x, .@y;
+ if (rand(0,10000) <= 100)
+ makeitem Candy, 1, .@m$, .@x, .@y;
+ }
+
+ // Mark the score if appliable and player is attached
if (playerattached()) {
- // Mark the score if appliable
if (@nestid == .@nest) {
.@q2=getq2(NivalisQuest_BlueSageSlimes)+1;
setq2 NivalisQuest_BlueSageSlimes, .@q2;
}
}
+ // All mobs are dead
if (!mobcount("020-7-1", "#BlueSageHUB::OnSlimeKill"+.@id)) {
if (playerattached()) {
// Did you killed all slimes? Or did they explode themselves?
@@ -242,8 +254,12 @@ function script BSProccessDeath {
.@q3=getq3(NivalisQuest_BlueSageSlimes);
setq3 NivalisQuest_BlueSageSlimes, .@q3 | .@nest;
dispbottom l("It wasn't easy, but you think that you extinguished this nest.");
+ if ((.@q3 | .@nest) == BS_SNESTALL)
+ dispbottom l("Perhaps that was the last of them?");
} else {
dispbottom l("You don't see any slimes from that nest anymore. But did you really get all of them?");
+ debugmes "Nest %d, killed %d/%d slimes", .@id, .@q2, .@ammo;
+ debugmes "NEST ID: %d / %d", @nestid, .@nest;
}
}
// Regardless of player attached or not, this nest must be clean
@@ -257,39 +273,39 @@ function script BSProccessDeath {
end;
OnSlimeKill1:
- BSProccessDeath(BS_SNEST1, BS_KNEST1);
+ BSProccessDeath(BS_SNEST1, $@BS_KNEST1);
end;
OnSlimeKill2:
- BSProccessDeath(BS_SNEST2, BS_KNEST2);
+ BSProccessDeath(BS_SNEST2, $@BS_KNEST2);
end;
OnSlimeKill3:
- BSProccessDeath(BS_SNEST3, BS_KNEST3);
+ BSProccessDeath(BS_SNEST3, $@BS_KNEST3);
end;
OnSlimeKill4:
- BSProccessDeath(BS_SNEST4, BS_KNEST4);
+ BSProccessDeath(BS_SNEST4, $@BS_KNEST4);
end;
OnSlimeKill5:
- BSProccessDeath(BS_SNEST5, BS_KNEST5);
+ BSProccessDeath(BS_SNEST5, $@BS_KNEST5);
end;
OnSlimeKill6:
- BSProccessDeath(BS_SNEST6, BS_KNEST6);
+ BSProccessDeath(BS_SNEST6, $@BS_KNEST6);
end;
OnSlimeKill7:
- BSProccessDeath(BS_SNEST7, BS_KNEST7);
+ BSProccessDeath(BS_SNEST7, $@BS_KNEST7);
end;
OnSlimeKill8:
- BSProccessDeath(BS_SNEST8, BS_KNEST8);
+ BSProccessDeath(BS_SNEST8, $@BS_KNEST8);
end;
OnSlimeKill9:
- BSProccessDeath(BS_SNEST9, BS_KNEST9);
+ BSProccessDeath(BS_SNEST9, $@BS_KNEST9);
end;
OnTouch:
@@ -301,5 +317,17 @@ OnCycle:
addtimer(1000, "#BlueSageHUB::OnCycle");
end;
+OnInit:
+ // K - Nest Kills
+ $@BS_KNEST1=3;
+ $@BS_KNEST2=2;
+ $@BS_KNEST3=1;
+ $@BS_KNEST4=4; // WS
+ $@BS_KNEST5=2;
+ $@BS_KNEST6=1;
+ $@BS_KNEST7=3;
+ $@BS_KNEST8=5; // WS
+ $@BS_KNEST9=1;
+ end;
}