22-- Area: Jugner Forest
33-- MOB: King Arthro
44---- -------------------------------
5+ require (" scripts/globals/status" );
56require (" scripts/globals/titles" );
6-
7- ---- -------------------------------
8- -- onMonsterMagicPrepare
97---- -------------------------------
108
11- function onMonsterMagicPrepare (mob , target )
9+ function onMobInitialize (mob )
10+ mob :setMobMod (MOBMOD_ADD_EFFECT , 1 );
11+ end ;
12+
13+ function onMobSpawn (mob )
14+ local KingArthroID = mob :getID ();
15+
16+ -- Use King Arthro ID to determine Knight Crab Id's, then set their respawn to 0 so they don't spawn while KA is up
17+ for offset = 1 , 10 do
18+ GetMobByID (KingArthroID - offset ):setRespawnTime (0 );
19+ end
20+
21+ -- Set the hp% to use hundred fists
22+ mob :setLocalVar (" jobSpecTrigger" , math.random (10 , 60 ));
23+
24+ -- 20 minute rage timer
25+ mob :setMobMod (MOBMOD_RAGE , 1200 );
26+ end ;
27+
28+ function onMobFight (mob , target )
29+ local trigger = mob :getLocalVar (" jobSpecTrigger" )
30+ if (mob :getHPP () <= trigger and mob :getLocalVar (" HundredFists" ) == 0 ) then
31+ mob :useMobAbility (jobSpec .HUNDRED_FISTS );
32+ mob :setLocalVar (" HundredFists" , 1 );
33+ end
34+ end ;
35+
36+ function onAdditionalEffect (mob ,target ,damage )
37+ local procRate = 10 ; -- No retail data, so we guessed at it.
38+ -- Can't proc it if enwater is up, if player full resists, or is just plain lucky.
39+ if (procRate > math.random (1 ,100 ) or mob :hasStatusEffect (EFFECT_ENWATER )
40+ or applyResistanceAddEffect (mob , target , ELE_ICE , 0 ) <= 0.5 ) then
41+ return 0 ,0 ,0 ;
42+ else
43+ target :addStatusEffect (EFFECT_PARALYSIS , 20 , 0 , 30 ); -- Potency unconfirmed
44+ return SUBEFFECT_PARALYSIS , msgBasic .ADD_EFFECT_STATUS , EFFECT_PARALYSIS ;
45+ end
46+ end ;
1247
48+ function onMonsterMagicPrepare (mob , target )
1349 -- Instant cast on spells - Waterga IV, Poisonga II, Drown, and Enwater
1450 local rnd = math.random ();
1551
@@ -22,44 +58,18 @@ function onMonsterMagicPrepare(mob, target)
2258 else
2359 return 105 ; -- Enwater
2460 end
25-
2661end ;
2762
28- ---- -------------------------------
29- -- onMobSpawn Action
30- ---- -------------------------------
31-
32- function onMobSpawn (mob )
33-
34- local KingArthroID = mob :getID ();
35-
36- -- Use King Arthro ID to determine Knight Crab Id's, then set their respawn to 0 so they don't spawn while KA is up
37- for offset = 1 , 10 do
38- GetMobByID (KingArthroID - offset ):setRespawnTime (0 );
39- end
40-
41- end
42-
43- ---- -------------------------------
44- -- onMobDeath
45- ---- -------------------------------
46-
4763function onMobDeath (mob , player , isKiller )
4864end ;
4965
50- ---- -------------------------------
51- -- onMobDespawn
52- ---- -------------------------------
53-
5466function onMobDespawn (mob )
55-
5667 local KingArthroID = mob :getID ();
57-
68+
5869 GetMobByID (KingArthroID ):setLocalVar (" [POP]King_Arthro" , 0 );
5970
6071 -- Set temporary respawn of 24 hours + 5 minutes
6172 for offset = 1 , 10 do
6273 GetMobByID (KingArthroID - offset ):setRespawnTime (86700 );
6374 end
64-
6575end ;
0 commit comments