forked from opentibiabr/otservbr-global-archived
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: raging mage spawn and improve performance (opentibiabr#1016)
* Correct Radius O script executava em 200~300ms, agora em 20ms. * fix: moving to new api Co-authored-by: Gabriel Pedro <[email protected]>
- Loading branch information
Showing
1 changed file
with
18 additions
and
9 deletions.
There are no files selected for viewing
27 changes: 18 additions & 9 deletions
27
data/creaturescripts/scripts/ragingmagetower/energized.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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
function onKill(cid, target, damage, flags) | ||
if(isMonster(target)) then | ||
if(string.lower(getCreatureName(target)) == "energized raging mage" and getGlobalStorageValue(673003) > 1999) then | ||
local monster = Game.createMonster("Raging Mage", getThingPos(cid)) -- 33389" y="31539" z="11" | ||
monster:setReward(true) | ||
-- doSummonCreature("raging mage", getThingPos(cid)) | ||
doCreatureSayWithRadius(cid, "GNAAAAAHRRRG!! WHAT? WHAT DID YOU DO TO ME!! I... I feel the energies crawling away... from me... DIE!!!", TALKTYPE_ORANGE_1, 33143, 31527, {x = 33143, y = 31527, z = 2}) | ||
setGlobalStorageValue(673003, 0) | ||
end | ||
function onKill(player, creature, damage, flags) | ||
if not creature or not creature:isMonster() then | ||
return true | ||
end | ||
|
||
if creature:getName():lower() ~= "energized raging mage" then | ||
return true | ||
end | ||
|
||
if getGlobalStorageValue(673003) < 2000 then | ||
return true | ||
end | ||
|
||
local monster = Game.createMonster("Raging Mage", creature:getPosition()) | ||
monster:setReward(true) | ||
|
||
doCreatureSayWithRadius(player, "GNAAAAAHRRRG!! WHAT? WHAT DID YOU DO TO ME!! I... I feel the energies crawling away... from me... DIE!!!", TALKTYPE_ORANGE_1, 35, 71) | ||
setGlobalStorageValue(673003, 0) | ||
|
||
return true | ||
end |