Skip to content

Commit

Permalink
fix: raging mage spawn and improve performance (opentibiabr#1016)
Browse files Browse the repository at this point in the history
* 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
Diego-OT and gpedro authored Apr 15, 2020
1 parent 440d9d3 commit 3cab6b0
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions data/creaturescripts/scripts/ragingmagetower/energized.lua
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

0 comments on commit 3cab6b0

Please sign in to comment.