Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit e80af34

Browse files
authored
Merge pull request #7 from DarkstarProject/master
Sync to DSP current
2 parents fb8ce8d + a72563e commit e80af34

17 files changed

Lines changed: 178 additions & 66 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---------------------------------------------
2+
-- Erratic Flutter
3+
--
4+
-- Description: Deals Fire damage around the caster. Grants the effect of Haste.
5+
-- Family: Wamoura
6+
-- Monipulators: Wamoura (MON), Coral Wamoura (MON)
7+
-- Level (Monstrosity): 60
8+
-- TP Cost (Monstrosity): 1500 TP
9+
-- Type: Enhancing
10+
-- Element: Fire
11+
-- Can be dispelled: Yes
12+
-- Notes:
13+
-- Blue magic version is 307/1024 haste for 5 minutes. Wamaora haste is presumed identical.
14+
-- Wamoura version also deals Fire damage to targets around the wamoura.
15+
-- While it does not overwrite most forms of Slowga, Slow II, Slow II TP moves,
16+
-- Erratic Flutter does overwrite Hojo: Ni, Hojo: Ichi, and Slow.
17+
-- Player Blue magic version is wind element instead of fire.
18+
---------------------------------------------
19+
require("scripts/globals/monstertpmoves");
20+
require("scripts/globals/settings");
21+
require("scripts/globals/status");
22+
---------------------------------------------
23+
24+
function onMobSkillCheck(target,mob,skill)
25+
return 0;
26+
end;
27+
28+
function onMobWeaponSkill(target, mob, skill)
29+
local dmgmod = 1;
30+
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*1.5,ELE_FIRE,dmgmod,TP_NO_EFFECT);
31+
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_FIRE,MOBPARAM_IGNORE_SHADOWS);
32+
33+
MobBuffMove(mob, EFFECT_HASTE, 307, 0, 300); -- There is no message for the self buff aspect, only dmg.
34+
35+
target:delHP(dmg);
36+
return dmg;
37+
end;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---------------------------------------------
2+
-- White Wind
3+
--
4+
-- Description:
5+
-- HP recovery on all nearby mobs centered on the user.
6+
-- The higher the user's HP, the higher the HP recovery.
7+
-- Only used by certain puks.
8+
--
9+
-- Player Blue Magic Version uses MaxHP instead of current HP: floor(MaxHP/7)*2
10+
-- The math for mob version may be different, it's presumed to be the same here.
11+
---------------------------------------------
12+
require("scripts/globals/monstertpmoves");
13+
require("scripts/globals/settings");
14+
require("scripts/globals/status");
15+
require("scripts/globals/msg");
16+
---------------------------------------------
17+
18+
function onMobSkillCheck(target,mob,skill)
19+
return 0;
20+
end;
21+
22+
function onMobWeaponSkill(target, mob, skill)
23+
skill:setMsg(msgBasic.SKILL_RECOVERS_HP);
24+
-- Todo: verify/correct maths
25+
return MobHealMove(mob, math.floor(mob:getHP()/7)*2);
26+
end;

scripts/globals/npc_util.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,15 @@ function npcUtil.UpdateNPCSpawnPoint(id, minTime, maxTime, posTable, serverVar)
241241
end)
242242
end;
243243

244-
function npcUtil.fishingAnimation(npc, phaseDuration)
244+
function npcUtil.fishingAnimation(npc, phaseDuration, func)
245+
func = func or function(npc)
246+
-- return true to not loop again
247+
return false
248+
end
249+
250+
if func(npc) then
251+
return
252+
end
245253
npc:timer(phaseDuration * 1000, function(npc)
246254
local anims =
247255
{
@@ -276,6 +284,6 @@ function npcUtil.fishingAnimation(npc, phaseDuration)
276284
end
277285
end
278286
npc:setAnimation(nextAnimationId)
279-
npcUtil.fishingAnimation(npc, nextAnimationDuration)
287+
npcUtil.fishingAnimation(npc, nextAnimationDuration, func)
280288
end)
281289
end

scripts/zones/Jugner_Forest/mobs/King_Arthro.lua

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,50 @@
22
-- Area: Jugner Forest
33
-- MOB: King Arthro
44
-----------------------------------
5+
require("scripts/globals/status");
56
require("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-
2661
end;
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-
4763
function onMobDeath(mob, player, isKiller)
4864
end;
4965

50-
-----------------------------------
51-
-- onMobDespawn
52-
-----------------------------------
53-
5466
function 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-
6575
end;

scripts/zones/Jugner_Forest/mobs/Knight_Crab.lua

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,25 @@
33
-- MOB: Knight Crab
44
-----------------------------------
55
require("scripts/zones/Jugner_Forest/MobIDs");
6-
7-
-----------------------------------
8-
-- onMobSpawn Action
6+
require("scripts/globals/status");
97
-----------------------------------
108

119
function onMobSpawn(mob)
12-
13-
--If respawn and variable is not 0, then it respawned before someone killed all 10 crabs
10+
-- If respawn and variable is not 0, then it respawned before someone killed all 10 crabs
1411
local KingArthro = GetMobByID(KING_ARTHRO);
1512

1613
if (KingArthro:getLocalVar("[POP]King_Arthro") > 0) then
1714
KingArthro:setLocalVar("[POP]King_Arthro", KingArthro:getLocalVar("[POP]King_Arthro") - 1);
1815
end
1916

17+
-- 5 minute rage timer (ffxiah says 5, ffxiclopedia says 5-10, bg doesn't say at all)
18+
mob:setMobMod(MOBMOD_RAGE, 300);
2019
end;
2120

22-
-----------------------------------
23-
-- onMobDeath
24-
-----------------------------------
25-
2621
function onMobDeath(mob, player, isKiller)
2722
end;
2823

29-
-----------------------------------
30-
-- onMobDespawn
31-
-----------------------------------
32-
3324
function onMobDespawn(mob)
34-
3525
local KingArthro = GetMobByID(KING_ARTHRO);
3626

3727
KingArthro:setLocalVar("[POP]King_Arthro", KingArthro:getLocalVar("[POP]King_Arthro") + 1);
@@ -40,5 +30,4 @@ function onMobDespawn(mob)
4030
KingArthro:setLocalVar("[POP]King_Arthro", 0);
4131
SpawnMob(KING_ARTHRO); -- Pop King Arthro !
4232
end
43-
4433
end;

scripts/zones/Promyvion-Dem/MobIDs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MEMORY_STREAMS = {
1919
[21] = {-383, -4, -2, -278, 4, 2, {41}}, -- floor 2 return
2020
[31] = {-160, -4, 437, -157, 4, 441, {30}}, -- floor 3 return
2121
[32] = { -2, -4, -322, 2, 4, -317, {30}}, -- floor 3 return
22-
[41] = { 357, -4, 237, 361, 4, 242, {34,35}}, -- floor 4 return
22+
[41] = { 357, -4, 237, 361, 4, 242, {34}}, -- floor 4 return
2323
[16851268] = { 117, -4, -283, 122, 4, -277, {30}}, -- floor 1 MR1
2424
[16851272] = { -83, -4, -83, -77, 4, -76, {34,35}}, -- floor 2 MR1
2525
[16851273] = { -82, -4, 76, -77, 4, 80, {34,35}}, -- floor 2 MR2

scripts/zones/Promyvion-Dem/Zone.lua

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ end;
6060
function onRegionEnter(player,region)
6161
if (player:getAnimation() == 0) then
6262
local regionId = region:GetRegionID();
63-
local events = MEMORY_STREAMS[regionId][7];
64-
local event = events[math.random(#events)];
65-
if (regionId < 100 or GetNPCByID(regionId):getAnimation() == ANIMATION_OPEN_DOOR) then
63+
local event = nil;
64+
if (regionId < 100) then
65+
event = MEMORY_STREAMS[regionId][7][1];
66+
else
67+
local stream = GetNPCByID(regionId);
68+
if (stream ~= nil and stream:getAnimation() == ANIMATION_OPEN_DOOR) then
69+
event = stream:getLocalVar("destination");
70+
if (event == nil or event == 0) then -- this should never happen, but sanity check
71+
event = MEMORY_STREAMS[regionId][7][1];
72+
end
73+
end
74+
end
75+
if (event ~= nil) then
6676
player:startEvent(event);
6777
end
6878
end

scripts/zones/Promyvion-Dem/mobs/Memory_Receptacle.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ function onMobDeath(mob, player, isKiller)
5959
end
6060
end
6161
if (math.random(numAlive) == 1) then
62-
local stream = GetNPCByID(MEMORY_RECEPTACLES[mobId][3]);
62+
local streamId = MEMORY_RECEPTACLES[mobId][3];
63+
local stream = GetNPCByID(streamId);
64+
local events = MEMORY_STREAMS[streamId][7];
65+
local event = events[math.random(#events)];
66+
stream:setLocalVar("destination",event);
6367
stream:openDoor(180);
6468
end
6569
end

scripts/zones/Promyvion-Holla/MobIDs.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MEMORY_STREAMS = {
1919
[21] = {-122, -4, -2, -118, 4, 2, {41}}, -- floor 2 return
2020
[31] = {-162, -4, 118, -158, 4, 122, {42}}, -- floor 3 return
2121
[32] = { 158, -4, 238, 162, 4, 242, {42}}, -- floor 3 return
22-
[41] = { 118, -4, -322, 121, 4, -318, {33,34}}, -- floor 4 return
22+
[41] = { 118, -4, -322, 121, 4, -318, {33}}, -- floor 4 return
2323
[16843058] = { -42, -4, 198, -38, 4, 202, {37}}, -- floor 1 MR1
2424
[16843054] = {-240, -4, 38, -237, 4, 41, {33,34}}, -- floor 2 MR1
2525
[16843055] = {-282, -4, -42, -278, 4, -38, {33,34}}, -- floor 2 MR2

scripts/zones/Promyvion-Holla/Zone.lua

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ end;
6060
function onRegionEnter(player,region)
6161
if (player:getAnimation() == 0) then
6262
local regionId = region:GetRegionID();
63-
local events = MEMORY_STREAMS[regionId][7];
64-
local event = events[math.random(#events)];
65-
if (regionId < 100 or GetNPCByID(regionId):getAnimation() == ANIMATION_OPEN_DOOR) then
63+
local event = nil;
64+
if (regionId < 100) then
65+
event = MEMORY_STREAMS[regionId][7][1];
66+
else
67+
local stream = GetNPCByID(regionId);
68+
if (stream ~= nil and stream:getAnimation() == ANIMATION_OPEN_DOOR) then
69+
event = stream:getLocalVar("destination");
70+
if (event == nil or event == 0) then -- this should never happen, but sanity check
71+
event = MEMORY_STREAMS[regionId][7][1];
72+
end
73+
end
74+
end
75+
if (event ~= nil) then
6676
player:startEvent(event);
6777
end
6878
end

0 commit comments

Comments
 (0)