This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed creature events from monsters script interface (#353)
Scripts cannot be placed inside the monsters folder, as it is the monsters only interface, all other types of scripts need to be in the scripts folder.
- Loading branch information
Showing
5 changed files
with
95 additions
and
94 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
54 changes: 54 additions & 0 deletions
54
data/monster/quests/the_secret_library/bosses/grand_master_oberon_functions.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,54 @@ | ||
GrandMasterOberonAsking = { | ||
[1] = {msg = "You appear like a worm among men!"}, | ||
[2] = {msg = "The world will suffer for its iddle laziness!"}, | ||
[3] = {msg = "People fall at my feet when they see me coming!"}, | ||
[4] = {msg = "This will be the end of mortal man!"}, | ||
[5] = {msg = "I will remove you from this plane of existence!"}, | ||
[6] = {msg = "Dragons will soon rule this world, I am their herald!"}, | ||
[7] = {msg = "The true virtue of chivalry are my belief!"}, | ||
[8] = {msg = "I lead the most honourable and formidable following of knights!"}, | ||
[9] = {msg = "ULTAH SALID'AR, ESDO LO!"}, | ||
} | ||
|
||
GrandMasterOberonResponses = { | ||
[1] = {msg = "How appropriate, you look like something worms already got the better of!"}, | ||
[2] = {msg = "Are you ever going to fight or do you prefer talking!"}, | ||
[3] = {msg = "Even before they smell your breath?"}, | ||
[4] = {msg = "Then let me show you the concept of mortality before it!"}, | ||
[5] = {msg = "Too bad you barely exist at all!"}, | ||
[6] = {msg = "Excuse me but I still do not get the message!"}, | ||
[7] = {msg = "Dare strike up a Minnesang and you will receive your last accolade!"}, | ||
[8] = {msg = "Then why are we fighting alone right now?"}, | ||
[9] = {msg = "SEHWO ASIMO, TOLIDO ESD!"}, | ||
} | ||
|
||
GrandMasterOberonConfig = { | ||
Storage = { | ||
Asking = 1, | ||
Life = 2, | ||
Exhaust = 3, | ||
}, | ||
Monster = { | ||
"Falcon Knight", | ||
"Falcon Paladin" | ||
}, | ||
AmountLife = 3 | ||
} | ||
|
||
local function healOberon(monster) | ||
local storage = monster:getStorageValue(GrandMasterOberonConfig.Storage.Life) | ||
monster:setStorageValue(GrandMasterOberonConfig.Storage.Life, storage + 1) | ||
monster:addHealth(monster:getMaxHealth()) | ||
|
||
end | ||
|
||
function SendOberonAsking(monster) | ||
monster:registerEvent('OberonImmunity') | ||
local random = math.random(#GrandMasterOberonAsking) | ||
monster:say(GrandMasterOberonAsking[random].msg, TALKTYPE_MONSTER_SAY) | ||
monster:setStorageValue(GrandMasterOberonConfig.Storage.Asking, random) | ||
|
||
healOberon(monster) | ||
|
||
Game.createMonster(GrandMasterOberonConfig.Monster[math.random(#GrandMasterOberonConfig.Monster)], monster:getPosition(), true, true) | ||
end |
10 changes: 10 additions & 0 deletions
10
data/scripts/creaturescripts/monster/grand_master_oberon_immunity.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,10 @@ | ||
local grandMasterOberonImmunity = CreatureEvent("OberonImmunity") | ||
|
||
function grandMasterOberonImmunity.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) | ||
if creature and creature:isMonster() then | ||
creature:getPosition():sendMagicEffect(CONST_ME_HOLYAREA) | ||
end | ||
return true | ||
end | ||
|
||
grandMasterOberonImmunity:register() |
22 changes: 22 additions & 0 deletions
22
data/scripts/creaturescripts/monster/mirror_image_transform.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,22 @@ | ||
local mirrorImageTransform = CreatureEvent("MirrorImageTransform") | ||
|
||
function mirrorImageTransform.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType) | ||
if attacker and attacker:isPlayer() then | ||
local newForm = nil | ||
if attacker:isSorcerer() then | ||
newForm = "Sorcerer's Apparition" | ||
elseif attacker:isDruid() then | ||
newForm = "Druid's Apparition" | ||
elseif attacker:isPaladin() then | ||
newForm = "Paladin's Apparition" | ||
elseif attacker:isKnight() then | ||
newForm = "Knight's Apparition" | ||
end | ||
if newForm and creature then | ||
creature:setType(newForm) | ||
end | ||
end | ||
return primaryDamage, primaryType, secondaryDamage, secondaryType | ||
end | ||
|
||
mirrorImageTransform:register() |