blob: 2a39fbeeefb144ac52b9c08acf3d2f69b69b2424 (
plain) (
tree)
|
|
// TMW2 Scripts
// Author: Crazyfefe
// Jesusalva
// Desc: Mob Points for Aidan & Ishi. You will gain MONSTER-LEVEL mob points.
// fix_mobkill(mobID) → Manual fix for scripted mobs
function script fix_mobkill {
killedrid=getarg(0);
doevent "#GlobalHandler::OnNPCKillEvent";
return;
}
function script MobPoints {
$MONSTERS_KILLED+=1;
MONSTERS_KILLED+=1;
@mobId=killedrid;
if (MPQUEST) {
.@moblv=strmobinfo(3,killedrid);
// You get MobLv + 20% as MobPoints.
// So a level 100 monster gives you 120 MobPt. Slimes gives no bonus.
if (compare("slime", strtolower(strmobinfo(1, killedrid))))
.@addval=.@moblv;
else
.@addval=.@moblv*12/10;
// Penalty/Bonus
.@base=(.@moblv-BaseLevel);
if (BaseLevel < .@moblv) {
// Target is stronger, +3% per monster level, capped at +75%
.@addval = .@addval * limit(100, 100+(.@base*3), 175) / 100;
} else if (BaseLevel > .@moblv) {
// Target is weaker, -1% per monster level, capped at -50%
.@addval = .@addval * limit(50, 101+.@base, 100) / 100;
}
// Sanitization
.@addval=max(0, .@addval);
// Grant you the Monster Points
Mobpt+=.@addval;
}
callfunc "ValonCount";
if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobId == $@ValonMob[@valon_mob]))
callfunc("AddValonCntMask");
if ((@mobId == 1003) || (@mobId == 1004) || (@mobId == 1009) || (@mobId == 1057)
|| (@mobId == 1104) || (@mobId == 1105) || (@mobId == 1106) || (@mobId == 1107))
goto L_Good;
// Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
@value = 0;
if (@mobId == 1018)
@value = 3;
if (@mobId == 1020)
@value = 3;
if (@mobId == 1027)
@value = 3;
if (@mobId == 1028)
@value = 4;
if (@mobId == 1038)
@value = 2;
if (@mobId == 1094)
@value = 3;
if (@mobId == 1112)
@value = 3;
if (@mobId == 1113)
@value = 3;
if (@value == 0)
goto L_Celestia;
callfunc "QuestSagathaAnnoy";
goto L_Celestia;
L_Good:
@value = 1;
callfunc "QuestSagathaHappy";
goto L_Celestia;
L_Celestia:
if (QL_CELESTIA < 5 || QL_CELESTIA >= 205 || @mobId != 1072) goto L_Return;
QL_CELESTIA = QL_CELESTIA + 1;
if (QL_CELESTIA == 205)
message strcharinfo(0), "Yeti : ##3This should be enough yetis killed to please Celestia.";
goto L_Return;
L_Return:
@value = 0;
return;
}
|