-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4381 from CatsAndBoats/chigoes
Implement Chigoe "Pets" on ToAU Mobs
- Loading branch information
Showing
16 changed files
with
223 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
-- Chigoe(pet) family mixin | ||
|
||
require('scripts/globals/mixins') | ||
|
||
g_mixins = g_mixins or {} | ||
g_mixins.families = g_mixins.families or {} | ||
|
||
local jobAbilities = set{ | ||
xi.jobAbility.SHIELD_BASH, | ||
xi.jobAbility.JUMP, | ||
xi.jobAbility.HIGH_JUMP, | ||
xi.jobAbility.WEAPON_BASH, | ||
xi.jobAbility.CHI_BLAST, | ||
xi.jobAbility.TOMAHAWK, | ||
xi.jobAbility.ANGON, | ||
xi.jobAbility.QUICKSTEP, | ||
xi.jobAbility.BOXSTEP, | ||
xi.jobAbility.STUTTER_STEP, | ||
xi.jobAbility.FEATHER_STEP, | ||
} | ||
|
||
g_mixins.families.chigoe_pet = function(hostMob) | ||
local ID = zones[hostMob:getZoneID()] | ||
|
||
hostMob:addListener('WEAPONSKILL_USE', 'MOB_SPAWN_CHIGOE', function(mob) | ||
local mobName = mob:getName() | ||
|
||
if ID.mob.CHIGOES[mobName] == nil then | ||
return | ||
end | ||
|
||
for _, mobID in pairs(ID.mob.CHIGOES[mobName]) do | ||
local chigoe = GetMobByID(mobID) | ||
|
||
if not chigoe:isSpawned() then | ||
chigoe:setSpawn(hostMob:getXPos() + math.random(-2, 2), hostMob:getYPos() + math.random(-2, 2), hostMob:getZPos() + math.random(-2, 2), hostMob:getRotPos()) | ||
chigoe:spawn() | ||
|
||
chigoe:addListener('CRITICAL_TAKE', 'CHIGOE_CRITICAL_TAKE', function(chigoeMob) | ||
chigoeMob:setMobMod(xi.mobMod.EXP_BONUS, -100) | ||
chigoeMob:setHP(0) | ||
end) | ||
|
||
chigoe:addListener('WEAPONSKILL_TAKE', 'CHIGOE_WEAPONSKILL_TAKE', function(chigoeMob, wsid) | ||
if wsid then | ||
chigoeMob:setMobMod(xi.mobMod.EXP_BONUS, -100) | ||
chigoeMob:setHP(0) | ||
end | ||
end) | ||
|
||
chigoe:addListener('ABILITY_TAKE', 'CHIGOE_ABILITY_TAKE', function(chigoeMob, user, ability, action) | ||
if jobAbilities[ability:getID()] then | ||
chigoeMob:setMobMod(xi.mobMod.EXP_BONUS, -100) | ||
chigoeMob:setHP(0) | ||
end | ||
end) | ||
|
||
chigoe:addListener('DEATH', 'CHIGOE_DEATH', function(chigoeMob) | ||
chigoeMob:removeListener('CHIGOE_CRITICAL_TAKE') | ||
chigoeMob:removeListener('CHIGOE_WEAPONSKILL_TAKE') | ||
chigoeMob:removeListener('CHIGOE_ABILITY_TAKE') | ||
end) | ||
|
||
return | ||
end | ||
end | ||
end) | ||
end | ||
|
||
return g_mixins.families.chigoe_pet |
15 changes: 15 additions & 0 deletions
15
scripts/zones/Aydeewa_Subterrane/mobs/Aydeewa_Diremite.lua
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,15 @@ | ||
----------------------------------- | ||
-- Area: Aydeewa Subterrane | ||
-- Mob: Aydeewa Diremite | ||
----------------------------------- | ||
mixins = { require('scripts/mixins/families/chigoe_pet') } | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
end | ||
|
||
return entity |
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,15 @@ | ||
----------------------------------- | ||
-- Area: Bhaflau Thickets | ||
-- Mob: Grand Marid | ||
----------------------------------- | ||
mixins = { require('scripts/mixins/families/chigoe_pet') } | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
end | ||
|
||
return entity |
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,15 @@ | ||
----------------------------------- | ||
-- Area: Caedarva Mire | ||
-- Mob: Mosshorn | ||
----------------------------------- | ||
mixins = { require('scripts/mixins/families/chigoe_pet') } | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
end | ||
|
||
return entity |
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,15 @@ | ||
----------------------------------- | ||
-- Area: Wajaom Woodlands | ||
-- Mob: Grand Marid | ||
----------------------------------- | ||
mixins = { require('scripts/mixins/families/chigoe_pet') } | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
end | ||
|
||
return entity |
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,15 @@ | ||
----------------------------------- | ||
-- Area: Wajaom Woodlands | ||
-- Mob: Marid | ||
----------------------------------- | ||
mixins = { require('scripts/mixins/families/chigoe_pet') } | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
end | ||
|
||
return entity |
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