• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Zombie event 1.5 - downgrade 8.6 by nekiro

bybbzan

mapper
Joined
Aug 4, 2012
Messages
809
Solutions
2
Reaction score
136
Location
Sweden
Zombies doesn't hit me. No errors in console, what did i miss?

60307f56b182699946fd996a96ec21fa.png

Creaturescript.lua
Lua:
function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local monster = Monster(cid)
    monster:say("OH SH*T! >.<", TALKTYPE_ORANGE_2)
    monster:getPosition():sendMagicEffect(CONST_ME_MORTAREA)
    doSummonZombie()
    ze_zombie_count = ze_zombie_count - 1
end

function onPrepareDeath(cid, killer)
    local player = Player(cid)
    local winner = 0
    if player:getStorageValue(ze_join_storage) == 1 then
        ze_joined_count = ze_joined_count - 1
        player:teleportTo(player:getTown():getTemplePosition(), false)
        player:setStorageValue(ze_join_storage, 0)
        player:addHealth(player:getMaxHealth())
        Game.broadcastMessage(player:getName() .. " was killed. " .. ze_joined_count .. " players left in the arena.", MESSAGE_STATUS_WARNING)
        if ze_joined_count <= 1 then --Event ended, someone won!
            local players = Game.getPlayers()
            for _, tmpPlayer in ipairs(players) do
                local stor = tmpPlayer:getStorageValue(ze_join_storage)
                if stor == 1 then
                    winner = tmpPlayer:getId()
                end
            end

            winner = Player(winner)
            if winner ~= nil then
                local rewardId = { 10127, 5919 }
                local random = rewardId[math.random(#rewardId)]
                winner:addItem(random, 1)
                winner:teleportTo(winner:getTown():getTemplePosition(), false)
                local trophy = winner:addItem(ze_trophy, 1)
                if trophy then
                    trophy:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, "["..winner:getName().."] "..ze_trophy_desc)
                end
                Game.broadcastMessage(winner:getName() .. " is the winner of zombie event versus " .. ze_zombie_count .. " Zombies! He won a " .. ItemType(random):getName() .. ".", MESSAGE_STATUS_WARNING)
            end
            doClearZombieArena()
            resetVariables()
        end
        return false
    end
    return true
end

zombie.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Zombie" nameDescription="a event zombie" race="undead" experience="0" speed="100" manacost="0">
    <health now="500" max="500"/>
    <look type="311" corpse="0"/>
    <targetchange interval="4000" chance="10"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="9999999" attack="9999999"/>
    </attacks>
    <defenses armor="15" defense="15"/>
    <elements>
        <element firePercent="50"/>
    </elements>
    <immunities>
        <immunity death="1"/>
        <immunity energy="1"/>
        <immunity ice="1"/>
        <immunity earth="1"/>
        <immunity drown="1"/>
        <immunity drunk="1"/>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
    </immunities>
    <voices interval="5000" chance="10">
        <voice sentence="Mst.... klll...."/>
        <voice sentence="Whrrrr... ssss.... mmm.... grrrrl"/>
        <voice sentence="Dnnnt... cmmm... clsrrr...."/>
        <voice sentence="Httt.... hmnnsss..."/>
    </voices>
    <script>
            <event name="ZE_Mon_Death"/>
        </script>
</monster>
 
Friend, use Snavy's system; it's more complete and up-to-date. Here's the link...
 
Back
Top