This repository has been archived by the owner on Dec 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/trust' into canary
- Loading branch information
Showing
24 changed files
with
345 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
----------------------------------------- | ||
-- ID: 5433 | ||
-- Item: Dusty Elixir | ||
-- Item Effect: Instantly restores 25% of HP and MP | ||
----------------------------------------- | ||
require("scripts/globals/msg") | ||
|
||
function onItemCheck(target) | ||
local result = 0 | ||
local mHP = target:getMaxHP() | ||
local cHP = target:getHP() | ||
local mMP = target:getMaxMP() | ||
local cMP = target:getMP() | ||
|
||
if mHP == cHP and mMP == cMP then | ||
result = 56 -- Does not let player use item if their hp and mp are full | ||
end | ||
|
||
return result | ||
end | ||
|
||
function onItemUse(target) | ||
target:addHP(target:getMaxHP() * .25) | ||
target:addMP(target:getMaxMP() * .25) | ||
target:messageBasic(tpz.msg.basic.RECOVERS_HP_AND_MP) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
----------------------------------------- | ||
-- ID: 5837 | ||
-- Item: tube_of_clear_salve_i | ||
-- Item Effect: Instantly removes 1-2 negative status effects at random from pet | ||
----------------------------------------- | ||
require("scripts/globals/settings") | ||
require("scripts/globals/msg") | ||
|
||
function onItemCheck(target) | ||
if not target:hasPet() then | ||
return tpz.msg.basic.REQUIRES_A_PET | ||
end | ||
return 0 | ||
end | ||
|
||
function onItemUse(target) | ||
local pet = target:getPet() | ||
local effects = | ||
{ | ||
tpz.effect.PETRIFICATION, | ||
tpz.effect.SILENCE, | ||
tpz.effect.BANE, | ||
tpz.effect.CURSE_II, | ||
tpz.effect.CURSE_I, | ||
tpz.effect.PARALYSIS, | ||
tpz.effect.PLAGUE, | ||
tpz.effect.POISON, | ||
tpz.effect.DISEASE, | ||
tpz.effect.BLINDNESS | ||
} | ||
|
||
local count = math.random(1, 2) | ||
local statusEffectTable = utils.shuffle(effects) | ||
|
||
local function removeStatus() | ||
for _, effect in ipairs(statusEffectTable) do | ||
if pet:delStatusEffect(effect) then return true end | ||
end | ||
if pet:eraseStatusEffect() ~= 255 then return true end | ||
return false | ||
end | ||
|
||
local removed = 0 | ||
|
||
for i = 0, count do | ||
if not removeStatus() then break end | ||
removed = removed + 1 | ||
if removed >= count then break end | ||
end | ||
|
||
return removed | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
----------------------------------------- | ||
-- ID: 5838 | ||
-- Item: tube_of_clear_salve_ii | ||
-- Item Effect: Instantly removes all negative status effects from pet | ||
----------------------------------------- | ||
require("scripts/globals/settings") | ||
require("scripts/globals/msg") | ||
|
||
function onItemCheck(target) | ||
if not target:hasPet() then | ||
return tpz.msg.basic.REQUIRES_A_PET | ||
end | ||
return 0 | ||
end | ||
|
||
function onItemUse(target) | ||
local pet = target:getPet() | ||
|
||
local effects = | ||
{ | ||
tpz.effect.PETRIFICATION, | ||
tpz.effect.SILENCE, | ||
tpz.effect.BANE, | ||
tpz.effect.CURSE_II, | ||
tpz.effect.CURSE_I, | ||
tpz.effect.PARALYSIS, | ||
tpz.effect.PLAGUE, | ||
tpz.effect.POISON, | ||
tpz.effect.DISEASE, | ||
tpz.effect.BLINDNESS | ||
} | ||
|
||
local count = 10 | ||
local statusEffectTable = effects | ||
|
||
local function removeStatus() | ||
for _, effect in ipairs(statusEffectTable) do | ||
if pet:delStatusEffect(effect) then return true end | ||
end | ||
if pet:eraseStatusEffect() ~= 255 then return true end | ||
return false | ||
end | ||
|
||
local removed = 0 | ||
|
||
for i = 0, count do | ||
if not removeStatus() then break end | ||
removed = removed + 1 | ||
if removed >= count then break end | ||
end | ||
|
||
return removed | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
----------------------------------------- | ||
-- ID: 5835 | ||
-- Item: tube_of_healing_salve_i | ||
-- Item Effect: Instantly restores 50% of pet HP | ||
----------------------------------------- | ||
require("scripts/globals/settings") | ||
require("scripts/globals/msg") | ||
|
||
function onItemCheck(target) | ||
if not target:hasPet() then | ||
return tpz.msg.basic.REQUIRES_A_PET | ||
end | ||
return 0 | ||
end | ||
|
||
function onItemUse(target) | ||
local pet = target:getPet() | ||
local totalHP = pet:getMaxHP() / 2 | ||
pet:addHP(totalHP) | ||
pet:messageBasic(tpz.msg.basic.RECOVERS_HP, 0, totalHP) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
----------------------------------------- | ||
-- ID: 5836 | ||
-- Item: tube_of_healing_salve_ii | ||
-- Item Effect: Instantly restores 100% of pet HP | ||
----------------------------------------- | ||
require("scripts/globals/settings") | ||
require("scripts/globals/msg") | ||
|
||
function onItemCheck(target) | ||
if not target:hasPet() then | ||
return tpz.msg.basic.REQUIRES_A_PET | ||
end | ||
return 0 | ||
end | ||
|
||
function onItemUse(target) | ||
local pet = target:getPet() | ||
local totalHP = pet:getMaxHP() | ||
pet:addHP(totalHP) | ||
pet:messageBasic(tpz.msg.basic.RECOVERS_HP, 0, totalHP) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.