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

Commit

Permalink
Trust Basics (#364)
Browse files Browse the repository at this point in the history
Co-authored-by: Omnione <10185476+Omnione@users.noreply.github.com>
Co-authored-by: TeoTwawki <arawn.annwn@yandex.com>
  • Loading branch information
3 people authored Mar 26, 2020
1 parent a830bb2 commit 86fd9f3
Show file tree
Hide file tree
Showing 181 changed files with 3,246 additions and 674 deletions.
6 changes: 3 additions & 3 deletions scripts/commands/addalltrusts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function onTrigger(player, target)
896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,
921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,
946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,
971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,1004,1005,1006,1007,1008,1009,
1010,1011,1012,1013,1014,1015,1016
971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,
996,997,998,999,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019
}

-- validate target
Expand All @@ -45,5 +45,5 @@ function onTrigger(player, target)
end
targ:addSpell(ValidSpells[i], silent, save)
end
player:PrintToPlayer(string.format("%s now has all spells.", targ:getName()))
player:PrintToPlayer(string.format("%s now has all trusts.", targ:getName()))
end
5 changes: 4 additions & 1 deletion scripts/commands/hp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ function onTrigger(player, hp, target)

-- validate target
local targ
if (target == nil) then
local cursor_target = player:getCursorTarget()
if cursor_target ~= nil then
targ = cursor_target
elseif target == nil then
targ = player
else
targ = GetPlayerByName(target)
Expand Down
8 changes: 8 additions & 0 deletions scripts/globals/magic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,14 @@ function getCureAsNukeFinal(caster,spell,power,divisor,constant,basepower)
return getCureFinal(caster,spell,power,divisor,constant,basepower)
end

function isValidHealTarget(caster, target)
return target:getAllegiance() == caster:getAllegiance() and
(target:getObjType() == tpz.objType.PC or
target:getObjType() == tpz.objType.MOB or
target:getObjType() == tpz.objType.TRUST or
target:getObjType() == tpz.objType.FELLOW)
end

-----------------------------------
-- Returns the staff bonus for the caster and spell.
-----------------------------------
Expand Down
15 changes: 15 additions & 0 deletions scripts/globals/mobskills/provoke.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---------------------------------------------
-- Provoke
---------------------------------------------
require("scripts/globals/msg")
require("scripts/globals/status")
---------------------------------------------

function onMobSkillCheck(target,mob,skill)
return 0
end

function onMobWeaponSkill(target, mob, skill)
target:addEnmity(mob, 1, 1800)
skill:setMsg(tpz.msg.basic.NONE)
end
15 changes: 15 additions & 0 deletions scripts/globals/mobskills/sentinel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---------------------------------------------------
-- Sentinel
---------------------------------------------------
require("scripts/globals/msg")
require("scripts/globals/status")
---------------------------------------------------

function onMobSkillCheck(target,mob,skill)
return 0
end

function onMobWeaponSkill(target, mob, skill)
target:addEnmity(mob, 1, 1800)
skill:setMsg(tpz.msg.basic.NONE)
end
4 changes: 4 additions & 0 deletions scripts/globals/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,8 @@ tpz.msg.basic =
DESPOIL_EVA_DOWN = 597, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Evasion Down.
DESPOIL_ACC_DOWN = 598, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Accuracy Down.
DESPOIL_SLOW = 599, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Slow.

-- TRUST & ALTER EGO
TRUST_NO_CAST_TRUST = 700, -- You are unable to use Trust magic at this time.
TRUST_NO_CALL_AE = 717, -- You cannot call forth alter egos here.
}
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function onSpellCast(caster,target,spell)
end
end

if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then
if isValidHealTarget(caster, target) then
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant)
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_ii.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function onSpellCast(caster,target,spell)
end
end

if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then
if isValidHealTarget(caster, target) then
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant)
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_iii.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function onSpellCast(caster,target,spell)
end
end

if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then
if isValidHealTarget(caster, target) then
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant)
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_iv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function onSpellCast(caster,target,spell)
basepower = 0
end
end
if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then
if isValidHealTarget(caster, target) then
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant)
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_v.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function onSpellCast(caster,target,spell)
end
end

if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then -- e.g. is a PC and not a monster (?)
if isValidHealTarget(caster, target) then -- e.g. is a PC and not a monster (?)
if (USE_OLD_CURE_FORMULA == true) then
basecure = getBaseCureOld(power,divisor,constant)
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/spells/cure_vi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function onSpellCast(caster,target,spell)
basepower = 0
end

if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then
if isValidHealTarget(caster, target) then
basecure = getBaseCure(power,divisor,constant,basepower)
final = getCureFinal(caster,spell,basecure,minCure,false)
if (caster:hasStatusEffect(tpz.effect.AFFLATUS_SOLACE) and target:hasStatusEffect(tpz.effect.STONESKIN) == false) then
Expand Down
14 changes: 0 additions & 14 deletions scripts/globals/spells/trust/Shantotto_II.lua

This file was deleted.

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aaev.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: AAEV
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aagk.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: AAGK
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aahm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: AAHM
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aamr.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: AAMR
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aatt.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: AATT
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/abenzio.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Abenzio
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/abquhbah.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Abquhbah
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/adelheid.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Adelheid
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

13 changes: 13 additions & 0 deletions scripts/globals/spells/trust/ajido-marujido.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----------------------------------------
-- Trust: Ajido-Marujido
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end
14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aldo.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Aldo
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 1007)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/aldo_uc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Aldo UC
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 930)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/amchuchu.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Amchuchu
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

13 changes: 13 additions & 0 deletions scripts/globals/spells/trust/apururu_uc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----------------------------------------
-- Trust: Apururu UC
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end
13 changes: 13 additions & 0 deletions scripts/globals/spells/trust/arciela.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----------------------------------------
-- Trust: Arciela
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 1017)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end
13 changes: 13 additions & 0 deletions scripts/globals/spells/trust/arciela_ii.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----------------------------------------
-- Trust: Arciela II
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell, 965)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end
14 changes: 14 additions & 0 deletions scripts/globals/spells/trust/areuhat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----------------------------------------
-- Trust: Areuhat
-----------------------------------------
require("scripts/globals/trust")
-----------------------------------------

function onMagicCastingCheck(caster, target, spell)
return tpz.trust.canCast(caster, spell)
end

function onSpellCast(caster, target, spell)
return tpz.trust.spawn(caster, spell)
end

Loading

0 comments on commit 86fd9f3

Please sign in to comment.