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

Commit

Permalink
Merge pull request #6276 from wrenffxi/getbcnmid
Browse files Browse the repository at this point in the history
fix prime avatars sending error messages to game server (also Ouryu)
  • Loading branch information
zynjec authored Nov 7, 2019
2 parents 2b213c7 + 43bd841 commit 028c27f
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 221 deletions.
47 changes: 22 additions & 25 deletions scripts/zones/Cloister_of_Flames/mobs/Ifrit_Prime.lua
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
-----------------------------------
-- Area: Cloister of Flames
-- Mob: Ifrit Prime
-- Involved in Quest: Trial by Fire
-- Involved in Quest: Trial by Fire, Trial Size Trial by Fire
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/settings")
require("scripts/globals/keyitems")
require("scripts/globals/status")
-----------------------------------

function onMobFight(mob, target)
local mobId = mob:getID();
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if mob:getBattlefieldID() == 547 then
mob:setLocalVar("astralflows", 0)
mob:setUnkillable(true)
end
end

function onMobFight(mob, target)
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID() == 547 and mob:getCurrentAction() == dsp.act.ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
if ((astralFlows == 0 and mob:getHPP() <= 80)
if mob:getBattlefieldID() == 547 and mob:getCurrentAction() == dsp.act.ATTACK then
local astralFlows = mob:getLocalVar("astralflows")
if (astralFlows == 0 and mob:getHPP() <= 80)
or (astralFlows == 1 and mob:getHPP() <= 60)
or (astralFlows == 2 and mob:getHPP() <= 40)
or (astralFlows == 3 and mob:getHPP() <= 20)
or (astralFlows == 4 and mob:getHPP() <= 1)) then
mob:setLocalVar("astralflows",astralFlows + 1);
mob:useMobAbility(848);
if (astralFlows >= 5) then
mob:setUnkillable(false);
or (astralFlows == 4 and mob:getHPP() <= 1) then
mob:setLocalVar("astralflows", astralFlows + 1)
mob:useMobAbility(848)
if astralFlows >= 5 then
mob:setUnkillable(false)
end
end
end

end;

function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID() == 547) then
mob:setLocalVar("astralflows","0");
mob:setUnkillable(true);
end
end;
end

function onMobDeath(mob, player, isKiller)
end;
end
47 changes: 22 additions & 25 deletions scripts/zones/Cloister_of_Frost/mobs/Shiva_Prime.lua
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
-----------------------------------
-- Area: Cloister of Frost
-- Mob: Shiva Prime
-- Involved in Quest: Trial by Ice
-- Involved in Quest: Trial by Ice, Trial Size Trial by Ice
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/keyitems")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------

function onMobFight(mob, target)
local mobId = mob:getID();
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if mob:getBattlefieldID() == 484 then
mob:setLocalVar("astralflows", 0)
mob:setUnkillable(true)
end
end

function onMobFight(mob, target)
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID() == 484 and mob:getCurrentAction() == dsp.act.ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
if ((astralFlows == 0 and mob:getHPP() <= 80)
if mob:getBattlefieldID() == 484 and mob:getCurrentAction() == dsp.act.ATTACK then
local astralFlows = mob:getLocalVar("astralflows")
if (astralFlows == 0 and mob:getHPP() <= 80)
or (astralFlows == 1 and mob:getHPP() <= 60)
or (astralFlows == 2 and mob:getHPP() <= 40)
or (astralFlows == 3 and mob:getHPP() <= 20)
or (astralFlows == 4 and mob:getHPP() <= 1)) then
mob:setLocalVar("astralflows",astralFlows + 1);
mob:useMobAbility(884);
if (astralFlows >= 5) then
mob:setUnkillable(false);
or (astralFlows == 4 and mob:getHPP() <= 1) then
mob:setLocalVar("astralflows", astralFlows + 1)
mob:useMobAbility(884)
if astralFlows >= 5 then
mob:setUnkillable(false)
end
end
end

end;

function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID() == 484) then
mob:setLocalVar("astralflows",0);
mob:setUnkillable(true);
end
end;
end

function onMobDeath(mob, player, isKiller)
end;
end
78 changes: 22 additions & 56 deletions scripts/zones/Cloister_of_Gales/mobs/Garuda_Prime.lua
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
-----------------------------------
-- Area: Cloister of Gales
-- Mob: Garuda Prime
-- Involved in Quest: Trial by Wind
-- Involved in Quest: Trial by Wind, Trial Size Trial by Wind
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
local ID = require("scripts/zones/Cloister_of_Gales/IDs")
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/keyitems")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------

function onMobFight(mob, target)
local mobId = mob:getID();
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if mob:getBattlefieldID() == 420 then
mob:setLocalVar("astralflows", 0)
mob:setUnkillable(true)
end
end

function onMobFight(mob, target)
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID() == 420 and mob:getCurrentAction() == dsp.act.ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
if ((astralFlows == 0 and mob:getHPP() <= 80)
if mob:getBattlefieldID() == 420 and mob:getCurrentAction() == dsp.act.ATTACK then
local astralFlows = mob:getLocalVar("astralflows")
if (astralFlows == 0 and mob:getHPP() <= 80)
or (astralFlows == 1 and mob:getHPP() <= 60)
or (astralFlows == 2 and mob:getHPP() <= 40)
or (astralFlows == 3 and mob:getHPP() <= 20)
or (astralFlows == 4 and mob:getHPP() <= 1)) then
mob:setLocalVar("astralflows",astralFlows + 1);
mob:useMobAbility(875);
if (astralFlows >= 5) then
mob:setUnkillable(false);
or (astralFlows == 4 and mob:getHPP() <= 1) then
mob:setLocalVar("astralflows", astralFlows + 1)
mob:useMobAbility(875)
if astralFlows >= 5 then
mob:setUnkillable(false)
end
end
end

end;

function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID() == 420) then
mob:setLocalVar("astralflows",0);
mob:setUnkillable(true);
end
end;
end

function onMobDeath(mob, player, isKiller)
if (mob:getBattlefield():getBcnmID() ~= 420) then
player:setCharVar("BCNM_Killed",1);
record = 300;
partyMembers = 6;
pZone = player:getZone();

player:startEvent(32001,0,record,0,(os.time() - player:getCharVar("BCNM_Timer")),partyMembers,0,0);
end
end;

function onEventUpdate(player,csid,option)
-- printf("onUpdate CSID: %u",csid);
-- printf("onUpdate RESULT: %u",option);

if (csid == 32001) then
player:delStatusEffect(dsp.effect.BATTLEFIELD);
end

end;

function onEventFinish(player,csid,option)
-- printf("onFinish CSID: %u",csid);
-- printf("onFinish RESULT: %u",option);

if (csid == 32001) then
player:delKeyItem(dsp.ki.TUNING_FORK_OF_WIND);
player:addKeyItem(dsp.ki.WHISPER_OF_GALES);
player:messageSpecial(ID.text.KEYITEM_OBTAINED,dsp.ki.WHISPER_OF_GALES);
end

end;
end
57 changes: 22 additions & 35 deletions scripts/zones/Cloister_of_Storms/mobs/Ramuh_Prime.lua
Original file line number Diff line number Diff line change
@@ -1,52 +1,39 @@
-----------------------------------
-- Area: Cloister of Storms
-- Mob: Ramuh Prime
-- Involved in Quest: Trial by Lightning
-- Involved in Quest: Trial by Lightning, Trial Size Trial by Lightning
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/keyitems")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------

function onMobFight(mob, target)
local mobId = mob:getID();
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if mob:getBattlefieldID() == 452 then
mob:setLocalVar("astralflows", 0)
mob:setUnkillable(true)
end
end

function onMobFight(mob, target)
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID() == 452 and mob:getCurrentAction() == dsp.act.ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
if ((astralFlows == 0 and mob:getHPP() <= 80)
if mob:getBattlefieldID() == 452 and mob:getCurrentAction() == dsp.act.ATTACK then
local astralFlows = mob:getLocalVar("astralflows")
if (astralFlows == 0 and mob:getHPP() <= 80)
or (astralFlows == 1 and mob:getHPP() <= 60)
or (astralFlows == 2 and mob:getHPP() <= 40)
or (astralFlows == 3 and mob:getHPP() <= 20)
or (astralFlows == 4 and mob:getHPP() <= 1)) then
mob:setLocalVar("astralflows",astralFlows + 1);
mob:useMobAbility(893);
if (astralFlows >= 5) then
mob:setUnkillable(false);
or (astralFlows == 4 and mob:getHPP() <= 1) then
mob:setLocalVar("astralflows", astralFlows + 1)
mob:useMobAbility(893)
if astralFlows >= 5 then
mob:setUnkillable(false)
end
end
end

end;

function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID() == 452) then
mob:setLocalVar("astralflows","0");
mob:setUnkillable(true);
end
end;
end

function onMobDeath(mob, player, isKiller)
end;

function onEventUpdate(player,csid,option)
-- printf("onUpdate CSID: %u",csid);
-- printf("onUpdate RESULT: %u",option);
end;

function onEventFinish(player,csid,option)
-- printf("onFinish CSID: %u",csid);
-- printf("onFinish RESULT: %u",option);
end;
end
45 changes: 21 additions & 24 deletions scripts/zones/Cloister_of_Tides/mobs/Leviathan_Prime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,36 @@
-- Involved in Quest: Trial by Water, Trial Size Trial by Water
-- Involved in Mission: ASA-4 Sugar Coated Directive
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/keyitems");
require("scripts/globals/status");
require("scripts/globals/keyitems")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------

function onMobFight(mob, target)
local mobId = mob:getID();
function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if mob:getBattlefieldID() == 611 then
mob:setLocalVar("astralflows", 0)
mob:setUnkillable(true)
end
end

function onMobFight(mob, target)
-- ASA-4: Astral Flow Behavior - Guaranteed to Use At Least 5 times before killable, at specified intervals.
if (mob:getBattlefield():getBcnmID() == 611 and mob:getCurrentAction() == dsp.act.ATTACK) then
local astralFlows = mob:getLocalVar("astralflows");
if ((astralFlows == 0 and mob:getHPP() <= 80)
if mob:getBattlefieldID() == 611 and mob:getCurrentAction() == dsp.act.ATTACK then
local astralFlows = mob:getLocalVar("astralflows")
if (astralFlows == 0 and mob:getHPP() <= 80)
or (astralFlows == 1 and mob:getHPP() <= 60)
or (astralFlows == 2 and mob:getHPP() <= 40)
or (astralFlows == 3 and mob:getHPP() <= 20)
or (astralFlows == 4 and mob:getHPP() <= 1)) then
mob:setLocalVar("astralflows",astralFlows + 1);
mob:useMobAbility(866);
if (astralFlows >= 5) then
mob:setUnkillable(false);
or (astralFlows == 4 and mob:getHPP() <= 1) then
mob:setLocalVar("astralflows", astralFlows + 1)
mob:useMobAbility(866)
if astralFlows >= 5 then
mob:setUnkillable(false)
end
end
end

end;

function onMobSpawn(mob)
-- ASA-4: Avatar is Unkillable Until Its Used Astral Flow At Least 5 times At Specified Intervals
if (mob:getBattlefield():getBcnmID() == 611) then
mob:setLocalVar("astralflows","0");
mob:setUnkillable(true);
end
end;
end

function onMobDeath(mob, player, isKiller)
end;
end
Loading

0 comments on commit 028c27f

Please sign in to comment.