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

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Omnione committed Jan 15, 2020
2 parents 03a8a77 + 6c82eb4 commit fac57e4
Show file tree
Hide file tree
Showing 26 changed files with 168 additions and 658 deletions.
3 changes: 1 addition & 2 deletions scripts/globals/caskets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5025,8 +5025,6 @@ end
---------------------------------------------------------------------------------------------
-- Desc: Casket spawn checks, runs through all checks before spawning
---------------------------------------------------------------------------------------------


dsp.caskets.spawnCasket = function (mob, player, x, y, z, r)
if mob == nil or player == nil then
return
Expand Down Expand Up @@ -5321,6 +5319,7 @@ dsp.caskets.onEventFinish = function(player, csid, option, npc)
-- Inputs
--------------------------------------------
elseif lockedChoice == 1 then -- Input a number

if inputNumber > 9 and inputNumber < 100 then
local splitNumbers = {}

Expand Down
14 changes: 2 additions & 12 deletions scripts/globals/items/bottle_of_ascetics_gambir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,12 @@
-----------------------------------------
require("scripts/globals/status")
-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.MEDICINE) then
result = 111
end
return result
return 0
end

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
target:addStatusEffect(dsp.effect.MAGIC_ATK_BOOST, 50, 3, 300)
target:addStatusEffect(dsp.effect.INTENSION, 100, 3, 300)
end
end
14 changes: 2 additions & 12 deletions scripts/globals/items/bottle_of_ascetics_tonic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,12 @@
-----------------------------------------
require("scripts/globals/status")
-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.MEDICINE) then
result = 111
end
return result
return 0
end

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
target:addStatusEffect(dsp.effect.MAGIC_ATK_BOOST, 25, 3, 300)
target:addStatusEffect(dsp.effect.INTENSION, 50, 3, 300)
end
end
96 changes: 28 additions & 68 deletions scripts/globals/items/bottle_of_catholicon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,84 +11,44 @@ require("scripts/globals/msg")
-----------------------------------------

function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.MEDICINE) then
result = 111
end
return result
return 0
end

function onItemUse(target)
local removables =
local removedCount = 0
local removable =
{
dsp.effect.SILENCE,
dsp.effect.BLINDNESS,
dsp.effect.POISON,
dsp.effect.PARALYSIS,
dsp.effect.DISEASE,
dsp.effect.PETRIFICATION,
dsp.effect.SILENCE,
dsp.effect.BIND,
dsp.effect.WEIGHT,
dsp.effect.SLOW,
dsp.effect.GRADUAL_PETRIFICATION,
dsp.effect.ADDLE,
dsp.effect.MUTE,
dsp.effect.BANE,
dsp.effect.CURSE_II,
dsp.effect.CURSE,
dsp.effect.PARALYSIS,
dsp.effect.PLAGUE,
dsp.effect.BURN,
dsp.effect.FROST,
dsp.effect.CHOKE,
dsp.effect.RASP,
dsp.effect.SHOCK,
dsp.effect.DROWN,
dsp.effect.DIA,
dsp.effect.BIO,
dsp.effect.STR_DOWN,
dsp.effect.DEX_DOWN,
dsp.effect.VIT_DOWN,
dsp.effect.AGI_DOWN,
dsp.effect.INT_DOWN,
dsp.effect.MND_DOWN,
dsp.effect.CHR_DOWN,
dsp.effect.MAX_HP_DOWN,
dsp.effect.MAX_MP_DOWN,
dsp.effect.ACCURACY_DOWN,
dsp.effect.ATTACK_DOWN,
dsp.effect.EVASION_DOWN,
dsp.effect.DEFENSE_DOWN,
dsp.effect.FLASH,
dsp.effect.MAGIC_DEF_DOWN,
dsp.effect.MAGIC_ACC_DOWN,
dsp.effect.MAGIC_ATK_DOWN,
dsp.effect.MAX_TP_DOWN,
dsp.effect.ATTACK_DOWN_II,
dsp.effect.DEFENSE_DOWN_II,
dsp.effect.MAGIC_ATK_DOWN_II,
dsp.effect.MAGIC_DEF_DOWN_II,
dsp.effect.ACCURACY_DOWN_II,
dsp.effect.EVASION_DOWN_II,
dsp.effect.MAGIC_ACC_DOWN_II,
dsp.effect.MAGIC_EVASION_DOWN_II,
dsp.effect.SLOW_II,
dsp.effect.PARALYSIS_II,
dsp.effect.WEIGHT_II,
dsp.effect.POISON,
dsp.effect.DISEASE,
dsp.effect.BLINDNESS
}

local count = 1

if target:eraseStatusEffect() == dsp.effect.NONE then
target:messageBasic(dsp.msg.basic.NO_EFFECT)
return
for _, status in pairs(removable) do
if target:hasStatusEffect(status) then
target:delStatusEffect(status)
removedCount = removedCount + 1
if removedCount == 3 then
break
end
end
end

for i, effect in ipairs(removables) do
if target:hasStatusEffect(effect) then
if target:delStatusEffect(effect) then
count = count + 1
if count == 3 then
break
end
if target:hasStatusEffectByFlag(dsp.effectFlag.ERASABLE) and removedCount < 3 then
for i=1, (3 - removedCount) do
target:eraseStatusEffect(dsp.effectFlag.ERASABLE)
removedCount = removedCount + 1
if removedCount == 3 then
break
end
end
end
end
if removedCount == 0 then
target:messageBasic(dsp.msg.basic.NO_EFFECT)
end
end
100 changes: 28 additions & 72 deletions scripts/globals/items/bottle_of_catholicon_+1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,44 @@ require("scripts/globals/msg")
-----------------------------------------

function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.MEDICINE) then
result = 111
end
return result
return 0
end

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
local removables =
local removedCount = 0
local removable =
{
dsp.effect.SILENCE,
dsp.effect.BLINDNESS,
dsp.effect.POISON,
dsp.effect.PARALYSIS,
dsp.effect.DISEASE,
dsp.effect.PETRIFICATION,
dsp.effect.SILENCE,
dsp.effect.BIND,
dsp.effect.WEIGHT,
dsp.effect.SLOW,
dsp.effect.GRADUAL_PETRIFICATION,
dsp.effect.ADDLE,
dsp.effect.MUTE,
dsp.effect.BANE,
dsp.effect.CURSE_II,
dsp.effect.CURSE,
dsp.effect.PARALYSIS,
dsp.effect.PLAGUE,
dsp.effect.BURN,
dsp.effect.FROST,
dsp.effect.CHOKE,
dsp.effect.RASP,
dsp.effect.SHOCK,
dsp.effect.DROWN,
dsp.effect.DIA,
dsp.effect.BIO,
dsp.effect.STR_DOWN,
dsp.effect.DEX_DOWN,
dsp.effect.VIT_DOWN,
dsp.effect.AGI_DOWN,
dsp.effect.INT_DOWN,
dsp.effect.MND_DOWN,
dsp.effect.CHR_DOWN,
dsp.effect.MAX_HP_DOWN,
dsp.effect.MAX_MP_DOWN,
dsp.effect.ACCURACY_DOWN,
dsp.effect.ATTACK_DOWN,
dsp.effect.EVASION_DOWN,
dsp.effect.DEFENSE_DOWN,
dsp.effect.FLASH,
dsp.effect.MAGIC_DEF_DOWN,
dsp.effect.MAGIC_ACC_DOWN,
dsp.effect.MAGIC_ATK_DOWN,
dsp.effect.MAX_TP_DOWN,
dsp.effect.ATTACK_DOWN_II,
dsp.effect.DEFENSE_DOWN_II,
dsp.effect.MAGIC_ATK_DOWN_II,
dsp.effect.MAGIC_DEF_DOWN_II,
dsp.effect.ACCURACY_DOWN_II,
dsp.effect.EVASION_DOWN_II,
dsp.effect.MAGIC_ACC_DOWN_II,
dsp.effect.MAGIC_EVASION_DOWN_II,
dsp.effect.SLOW_II,
dsp.effect.PARALYSIS_II,
dsp.effect.WEIGHT_II,
dsp.effect.POISON,
dsp.effect.DISEASE,
dsp.effect.BLINDNESS
}

local count = 1

if target:eraseStatusEffect() == dsp.effect.NONE then
target:messageBasic(dsp.msg.basic.NO_EFFECT)
return
for _, status in pairs(removable) do
if target:hasStatusEffect(status) then
target:delStatusEffect(status)
removedCount = removedCount + 1
if removedCount == 7 then
break
end
end
end

for i, effect in ipairs(removables) do
if target:hasStatusEffect(effect) then
if target:delStatusEffect(effect) then
count = count + 1
if count == 7 then
break
end
if target:hasStatusEffectByFlag(dsp.effectFlag.ERASABLE) and removedCount < 7 then
for i=1, (7 - removedCount) do
target:eraseStatusEffect(dsp.effectFlag.ERASABLE)
removedCount = removedCount + 1
if removedCount == 7 then
break
end
end
end
end
if removedCount == 0 then
target:messageBasic(dsp.msg.basic.NO_EFFECT)
end
end
14 changes: 2 additions & 12 deletions scripts/globals/items/bottle_of_champions_tonic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@
-----------------------------------------
require("scripts/globals/status")
-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
local result = 0
if target:hasStatusEffect(dsp.effect.MEDICINE) then
result = 111
end
return result
return 0
end

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
target:addStatusEffect(dsp.effect.POTENCY, 25, 3, 60)
end
end
Loading

0 comments on commit fac57e4

Please sign in to comment.