• 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!

Tower Defense Event [TFS 1.0 / 1.1]

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,284
Location
Sweden?
Hello, well i thougt about release a christmas present to everyone in otland. Here you go guys:
C_-PLWlam.png

Cheers @Ninja and @Limos for the help :)

Features:
  • Unlimited waves can be configured!
  • Monsters health, gold drop and speed can be configured!
  • Different monsters, counts and space between the monster can be configred!
  • Unlimited turrets can be added!
  • Turrets cost, upgrade, sell, range, color and attackSpeed can be also easily configured!
  • Reward of wining a wave can also be configured, exp and gold wise
First open data/actions/actions.xml and paste this line:
Code:
<action itemid="2557" script="twdHammer.lua" allowfaruse="1"/>

Then go to data/actions/scripts and create new lua and name it "twdHammer" and paste this:
Code:
dofile('data/libs/TWD/towerDefenseLib.lua')

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(playingGameStorage) ~= 1 then
        return false
    end

    local tile = toPosition:getTile()
    if tile then
        if not tile:hasFlag(TILESTATE_PROTECTIONZONE) or tile:hasProperty(CONST_PROP_IMMOVABLEBLOCKSOLID) then
            player:sendCancelMessage("You cannot place the turret here.")
            return true
        end
    end

    if target:isItem() then
        local modalWindow = ModalWindow(100, "Build Turret", "Here you can select variations of turrets to build.")
        local turret, cfgTable = turrets.allTurretsId
        for i = 1, #turret do
            turret = turrets.allTurretsId[i]
            cfgTable = turrets[turret].cfg
            modalWindow:addChoice(turret, string.format("%s [%s coins]", cfgTable.turretName, cfgTable[1].buildPrice))
        end

        modalWindow:addButton(0, "Build")
        modalWindow:setDefaultEnterButton(0)
        modalWindow:addButton(1, "Cancel")
        modalWindow:setDefaultEscapeButton(1)
        modalWindow:sendToPlayer(player)
        turretPosition = toPosition
    elseif target:isNpc() and target:getName() == "Turret" then
        local table = turrets[target:getOutfit().lookType]
        local lvl = target:getTurretLevel()
        local cfg, cfgCombat = table.cfg[lvl], table.combat[lvl]

        local turrentInfo = string.format("Turret Information\n----------------------------\nTurret Level: %s\nAttack Type: %s\nRange SQM: %sx%s\nTurret Damage: [%s - %s]\nAttack Speed: %s\nSell/Upgrade Price: [%s / %s]", lvl, string.upper(cfgCombat.attackType), cfg.rangeX, cfg.rangeY, cfgCombat.dmgValues[1], cfgCombat.dmgValues[2], cfg.attackSpeed, cfg.sellPrice, cfg.upgradePrice)
        local playerInfo = string.format("Player Information\n----------------------------\nWave Level: %s\nYour Coins: %s", getWaveLevel(), player:getCoins())
        local modalWindow = ModalWindow(101, "Information", string.format("%s\n\n%s", turrentInfo, playerInfo))

        if lvl < 3 then
            modalWindow:addChoice(0, "Upgrade")
        end
        modalWindow:addChoice(1, "Sell")

        modalWindow:addButton(0, "Yes")
        modalWindow:setDefaultEnterButton(0)
        modalWindow:addButton(0x01, "Cancel")
        modalWindow:setDefaultEscapeButton(1)
        modalWindow:sendToPlayer(player)
        targetTurret = target
    end
    return true
end

Now go into data/creaturescripts/creaturescripts.xml and paste these lines:
Code:
    <event type="death" name="TWDDeath" script="twdEvent/twdDeath.lua"/>
    <event type="preparedeath" name="TWDOnLose" script="twdEvent/twdOnLose.lua"/>
    <event type="modalwindow" name="TWDBuildWindow" script="twdEvent/twdBuildWindow.lua"/>
    <event type="modalwindow" name="TWDOtherWindow" script="twdEvent/twdOtherWindow.lua"/>
    <event type="healthchange" name="TWDHealthChange" script="twdEvent/twdHealthChange.lua"/>

And now go to data/creaturescripts/scripts and create new folder and name it twdEvent and now create these lua's files:

twdBuildWindow.lua
Code:
dofile('data/libs/TWD/towerDefenseLib.lua')

function onModalWindow(player, modalWindowId, buttonId, choiceId)
    if modalWindowId ~= 100 then -- Not our window
             return false
       elseif buttonId == 1 then -- Cancel
             return false
       end

     local choice = turrets[choiceId]
       if not choice then
        return false
    end

    local table = choice.cfg[1]
    if player:getCoins() < choice.cfg[1].buildPrice then
        player:sendCancelMessage("You don't have enough of coins.")
        return false
    end

    local npc = Game.createNpc("Turret", turretPosition, false, true)
    if not npc then
        return false
    end

    player:addCoins(-choice.cfg[1].buildPrice)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have total ".. player:getCoins() .." coins.")

    local setColor = table.colorId
    npc:setOutfit({lookType = choiceId, lookHead = setColor , lookBody = setColor, lookLegs = setColor, lookFeet = setColor})
    npc:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
       return true
end

twdDeath.lua
Code:
dofile('data/libs/TWD/towerDefenseLib.lua')

local function sendToNextWave(cid)
    local player = Player(cid)
    if not player then
        return false
    end

    local waveLevel = getWaveLevel()
    setWaveLevel(waveLevel + 1) -- Let's add + 1 to our current wave
    waveLevel = getWaveLevel() -- Let's refresh the variable

    if waveLevel <= waves.maxWaveLevel then -- Let's make sure there is more waves / Else end the event
        local waveTable = waves[waveLevel]
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have advanced to wave level %s, gained %s coins and %s experience points.", waveLevel, waveTable.goldBonus, waveTable.expBonus))
        startNextWave(waveLevel, twdConfig.startNextWaveTime)
        Game.setStorageValue(totalMonsterKillCountGlobalStorage, 0)
        player:addCoins(waveTable.goldBonus)
        player:addExperience(waveTable.expBonus, true)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have now total ".. player:getCoins() .." coins.")
    else
        sendReward(cid)
        resetEvent()
    end
end

function onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
    local player = getPlayerInEvent(20, 20)
    if not player then -- Make sure that the players exsist in the arena, to prevent errors
        return true
    end

    if killer and killer:isNpc() then
        local cfg = monsters[creature:getName()]
        creature:say("+" ..cfg.coins, TALKTYPE_MONSTER_SAY)
        player:addCoins(cfg.coins)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have total ".. player:getCoins() .." coins.")
    end

    Game.setStorageValue(totalMonsterKillCountGlobalStorage, Game.getStorageValue(totalMonsterKillCountGlobalStorage) + 1)
    if Game.getStorageValue(totalMonsterKillCountGlobalStorage) >= Game.getStorageValue(totalMonsterCountGlobalStorage) then
        sendToNextWave(player:getId())
    end
    return true
end

twdHealthChange.lua
Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if primaryType == COMBAT_HEALING then
        return false
    end

    return primaryDamage, primaryType, secondaryDamage, secondaryType
end

twdOnLose.lua
Code:
dofile('data/libs/TWD/towerDefenseLib.lua')


function onPrepareDeath(player, killer)
    if player:getStorageValue(playingGameStorage) ~= 1 then
        return true
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have lost the Tower Of Defence Event.")
    player:resetValues()
    addEvent(resetEvent, twdConfig.resetEventTime * 1000)
    return false
end

twdOtherWindow.lua
Code:
dofile('data/libs/TWD/towerDefenseLib.lua')

function onModalWindow(player, modalWindowId, buttonId, choiceId)
    if modalWindowId ~= 101 then -- Not our window
             return false
       elseif buttonId == 1 then -- Cancel
             return false
       end

    local npc = targetTurret
    local npcLvl = npc:getTurretLevel()
    local table = turrets[npc:getOutfit().lookType].cfg[npcLvl]

       if choiceId == 0 then
        if player:getCoins() < table.upgradePrice then
            player:sendCancelMessage("You don't have enough of coins.")
            return false
        end

        npcLvl = npcLvl + 1
        local setColor = table.colorId
        npc:setOutfit({lookType = npc:getOutfit().lookType, lookHead = setColor , lookBody = setColor, lookLegs = setColor, lookFeet = setColor, lookAddons = npcLvl})
        npc:getPosition():sendMagicEffect(math.random(CONST_ME_FIREWORK_YELLOW, CONST_ME_FIREWORK_BLUE))
        player:addCoins(-table.upgradePrice)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have total ".. player:getCoins() .." coins.")
        targetTurret = nil
    else
        player:addCoins(table.sellPrice)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You have total ".. player:getCoins() .." coins.")
        npc:say("+" ..table.sellPrice, TALKTYPE_MONSTER_SAY)
        player:addCoins(table.sellPrice)
        npc:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        npc:remove()
        targetTurret = nil
    end
       return true
end

Part 2 can be founded below!
 
Last edited:
Now create a new folder in data/ and name it libs. Now inside data/libs create new folder name it TWD and now it should be data/libs/TWD

Inside that folder we will create 3 new luas:

towerDefenseConfig.lua
Code:
twdConfig = {
    loseHealth = 10, -- How much % should player lose, when the monster walk inside your base
    eventStartTime = 30, -- How long until the event starts, when player step in the teleport [seconds]
    startingCoins = 200, -- How much coins should the player start with!
    startNextWaveTime = 15, -- How long until next wave starts [seconds]
    resetEventTime = 10 -- How long until next player can enter, if someone already was in there [30 seconds] is recommended.
}

-- Write unused storage
playingGameStorage = 1000
coinStorage = 1001

-- Write unused global storage
waveLevelGlobalStorage = 100 -- Here write
totalMonsterCountGlobalStorage = 101
totalMonsterKillCountGlobalStorage = 102

-- Positions
eventRoomPosition = Position(1011, 1077, 7) -- Where should player get teleported in the event room?
eventCenterPosition = Position(1014, 1084, 7) -- Center of the event room
summonMonsterPosition = Position(1003, 1076, 7) -- Where should the monster be created?

turrets = {
    -- AttackTypes = target, aoe and targetAoe
    -- When you create new turret, make sure to write it's looktype in the [allTurretsId]

    allTurretsId = {129},
    [129] = { -- This Example of a target/aoe and targetAoe Turrent [Define by lookType]
        combat = {
            [1] = {attackType = "target", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {10, 20}, magicEffect = CONST_ME_NONE, shootEffect = CONST_ANI_ARROW},
            [2] = {attackType = "targetAoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = burstArrowArea, dmgValues = {30, 50}, magicEffect = CONST_ME_FIREAREA, shootEffect = CONST_ANI_BURSTARROW},
            [3] = {attackType = "aoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = AREA_CIRCLE2X2, dmgValues = {50, 70}, magicEffect = CONST_ME_GROUNDSHAKER, shootEffect = CONST_ANI_NONE}
        },
        cfg = {
            turretName = "Starter Turret",
            [1] = {buildPrice = 60, sellPrice = 30, upgradePrice = 120, rangeX = 3, rangeY = 3, colorId = 64, attackSpeed = 1000},
            [2] = {sellPrice = 60, upgradePrice = 180, rangeX = 4, rangeY = 4, colorId = 64, attackSpeed = 800},
            [3] = {sellPrice = 120, upgradePrice = 0, rangeX = 6, rangeY = 6, colorId = 64, attackSpeed = 500}
        }
    }
}

monsters = {-- monsterName, "drop" coins, current Health + extraHealth, speed
    ["Rat"] = {
        coins = 5,
        extraHealth = 0,
        speed = 400
    },
    ["Cave Rat"] = {
        coins = 5,
        extraHealth = 10,
        speed = 100
    }
}

waves = {
    maxWaveLevel = 3,
    [1] = {
            interval = 1000,
        goldBonus = 100,
        expBonus = 200,
        monsters = {
                        {name = "Rat", count = 10, interval = 500}
            }
    },
    [2] = {
            interval = 1000,
        goldBonus = 150,
        expBonus = 3000,
        monsters = {
                        {name = "Cave Rat", count = 10, interval = 500}
            }
    },
    [3] = {
            interval = 1000,
        goldBonus = 300,
        expBonus = 500,
        monsters = {
                        {name = "Rat", count = 10, interval = 500},
            {name = "Cave Rat", count = 10, interval = 500}
            }
    }
}

towerDefenseLib.lua
http://pastebin.com/EAgvUEYS

towerDefenseSpellsArea.lua
Code:
burstArrowArea = createCombatArea{ {1, 1, 1}, {1, 3, 1}, {1, 1, 1} }
AREA_CIRCLE2X2 = createCombatArea{
    {0, 1, 1, 1, 0},
    {1, 1, 1, 1, 1},
    {1, 1, 3, 1, 1},
    {1, 1, 1, 1, 1},
    {0, 1, 1, 1, 0}
}

Now open data/movements/movements.xml and paste this line:
Code:
<movevent event="StepIn" fromuid="3333" touid="3334" script="twdTile.lua"/>

And inside data/movements/scripts and create new lua and name it "twdTile.lua" and paste the code below:
http://pastebin.com/bHhF2fcT

Now go into data/monster/monsters.xml and paste these lines:
Code:
    <!-- TWD Event -->
    <monster name="Rat_TWD" file="TWD Event/rat.xml"/>
    <monster name="Cave Rat_TWD" file="TWD Event/cave rat.xml"/>

Now in data/monster and create new folder and name it "TWD Event" and inside the folder create these xmls:

cave rat.xml
http://pastebin.com/KaWzB9Hk

rat.xml
http://pastebin.com/VwN1DWYV

Now go into data/npc and create new xml and name it "Turret.xml" and paste this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Turret" script="Turret.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="57" body="59" legs="40" feet="76" addons="0"/>
</npc>

Now in data/npc/scripts create new lua and name it "Turret.lua" and paste this code:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

dofile('data/libs/TWD/towerDefenseLib.lua')

local function searchForTarget(cid)
    local npc = Npc(cid)
    if not npc then
        return false
    end

    local lvl = npc:getTurretLevel()
    local table = turrets[npc:getOutfit().lookType]
    if not table then
        print("[ERROR]: This turret does not exsist in the turrets table.")
        return false
    end

    local cfg = table.cfg[lvl]
    npc:searchTarget(cfg.rangeX, cfg.rangeY)
    addEvent(searchForTarget, 100, cid)
end

local function onAttack(cid)
    local npc = Npc(cid)
    if not npc then
        return false
    end

    local lvl = npc:getTurretLevel()
    local table = turrets[npc:getOutfit().lookType]
    local cfg = table.cfg[lvl]

    if not table then
        print("[ERROR]: This turret does not exsist in the turrets table.")
        return false
    end

    local target = npc:getTarget()
    if target then
        local cfgCombat = table.combat[lvl]
        npc:shootSpell(cfgCombat.attackType, target, cfgCombat.combatType, cfgCombat.combatArea, cfgCombat.dmgValues[1], cfgCombat.dmgValues[2], cfgCombat.magicEffect, cfgCombat.shootEffect)
        npc:setFocus(target)
    end

    addEvent(onAttack, cfg.attackSpeed, cid)
end

function onCreatureAppear(creature)
    local cid = creature:getId()
    onAttack(cid)
    searchForTarget(cid)
    npcHandler:onCreatureAppear(creature)
end
 

Attachments

Last edited:
This is why we love you Printer.
Cheers mate :)

@Topic
I have made minor addition into the twdHammer. To make sure they are not creating the turrets on wall or inside the game field.
 
Thanks for the release!

If anyone is using a RLMap based server, you will probably get an error saying Duplication of registration events on item id 2557.
Simply change that item to another one or remove the already existing functionality for hammer by removing:
Code:
<action itemid="2557" script="tools/hammer.lua"/>
from actions.xml

Also, if you are running TFS 1.0 you might get an error like this:
Code:
twdHammer.lua:4: attempt to index local 'player' <a number value>

Go to twdHammer.lua and change:
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(playingGameStorage) ~= 1 then
        return false
    end

To:
Code:
function onUse(cid, item, fromPosition, target, toPosition, isHotkey)
    local player = Player(cid)
    if player:getStorageValue(playingGameStorage) ~= 1 then
        return false
    end

Thanks again for the release! I'll keep posting stuff if I find anything!
 
Btw, did you forget some file(s)?
There doesn't seem to be any functionality to start the event from what you've posted.
Only some config variables such as eventStartTime etc are defined but not used.
 
Oh forgot to post the teleport code. Ill do it when i'm home.
 
Seems to be nice. Would you post some more pictures or even a video of it? :)
 
Great work but I couldn't figure out why my spawned rats don't give a shit and they just go south, no matter if there are walls or grass they just go through them xD

Will test it a bit more and see whats going on.
 
Great work but I couldn't figure out why my spawned rats don't give a shit and they just go south, no matter if there are walls or grass they just go through them xD

Will test it a bit more and see whats going on.
Check out my thread and the changes for path finding. I remade the path finding system to be automatically detected, but my version only works with TFS 1.0.
 
Im a bit confused if i want to add another turret type can someone show me a sample script of it? ive tried a bunch of ways, but i always end up having just 1 on my list. no errors in my console
 
<look type="129" head="57" body="59" legs="40" feet="76" addons="0"/>
Just change the look type to what ever you want :)
Hope it helps :)
Regards.
Leon
 
I didnt mean that haha, but i got it anyways, well if you guys want to add more turrets just add them like this.

You just edit the all turrest id, add a "," comma after 129 and choose your looktypes, and just add the same looktype for the next turret for the combat and cfg.

Code:
.............................some more codes on top ...........................
...................
.................
............

turrets = {
    -- AttackTypes = target, aoe and targetAoe
    -- When you create new turret, make sure to write it's looktype in the [allTurretsId]

    allTurretsId = {129, 130},
    [129] = { -- This Example of a target/aoe and targetAoe Turrent [Define by lookType]
        combat = {
            [1] = {attackType = "target", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {10, 25}, magicEffect = CONST_ME_NONE, shootEffect = CONST_ANI_ARROW},
            [2] = {attackType = "targetAoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = burstArrowArea, dmgValues = {25, 40}, magicEffect = CONST_ME_FIREAREA, shootEffect = CONST_ANI_BURSTARROW},
            [3] = {attackType = "aoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = AREA_CIRCLE2X2, dmgValues = {40, 55}, magicEffect = CONST_ME_GROUNDSHAKER, shootEffect = CONST_ANI_NONE}
        },
        cfg = {
            turretName = "Archer Tower",
            [1] = {buildPrice = 60, sellPrice = 30, upgradePrice = 200, rangeX = 3, rangeY = 3, colorId = 64, attackSpeed = 2000},
            [2] = {sellPrice = 140, upgradePrice = 300, rangeX = 4, rangeY = 4, colorId = 64, attackSpeed = 1500},
            [3] = {sellPrice = 200, upgradePrice = 0, rangeX = 6, rangeY = 6, colorId = 64, attackSpeed = 1000}
        }
    },
    [130] = { -- This Example of a target/aoe and targetAoe Turrent [Define by lookType]
        combat = {
            [1] = {attackType = "target", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {30, 60}, magicEffect = CONST_ME_FIREAREA, shootEffect = CONST_ANI_FIRE},
            [2] = {attackType = "targetAoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = burstArrowArea, dmgValues = {60, 80}, magicEffect = CONST_ME_HOLYAREA, shootEffect = CONST_ANI_ENERGY},
            [3] = {attackType = "aoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {80, 90}, magicEffect = CONST_ME_MORTAREA, shootEffect = CONST_ANI_SUDDENDEATH}
        },
        cfg = {
            turretName = "Mage Tower",
            [1] = {buildPrice = 120, sellPrice = 60, upgradePrice = 400, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 2000},
            [2] = {sellPrice = 280, upgradePrice = 600, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 1500},
            [3] = {sellPrice = 400, upgradePrice = 0, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 1000}
        }
    }
}
......................................code on bottom....................
......................
..................
................
 
I didnt mean that haha, but i got it anyways, well if you guys want to add more turrets just add them like this.

You just edit the all turrest id, add a "," comma after 129 and choose your looktypes, and just add the same looktype for the next turret for the combat and cfg.

Code:
.............................some more codes on top ...........................
...................
.................
............

turrets = {
    -- AttackTypes = target, aoe and targetAoe
    -- When you create new turret, make sure to write it's looktype in the [allTurretsId]

    allTurretsId = {129, 130},
    [129] = { -- This Example of a target/aoe and targetAoe Turrent [Define by lookType]
        combat = {
            [1] = {attackType = "target", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {10, 25}, magicEffect = CONST_ME_NONE, shootEffect = CONST_ANI_ARROW},
            [2] = {attackType = "targetAoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = burstArrowArea, dmgValues = {25, 40}, magicEffect = CONST_ME_FIREAREA, shootEffect = CONST_ANI_BURSTARROW},
            [3] = {attackType = "aoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = AREA_CIRCLE2X2, dmgValues = {40, 55}, magicEffect = CONST_ME_GROUNDSHAKER, shootEffect = CONST_ANI_NONE}
        },
        cfg = {
            turretName = "Archer Tower",
            [1] = {buildPrice = 60, sellPrice = 30, upgradePrice = 200, rangeX = 3, rangeY = 3, colorId = 64, attackSpeed = 2000},
            [2] = {sellPrice = 140, upgradePrice = 300, rangeX = 4, rangeY = 4, colorId = 64, attackSpeed = 1500},
            [3] = {sellPrice = 200, upgradePrice = 0, rangeX = 6, rangeY = 6, colorId = 64, attackSpeed = 1000}
        }
    },
    [130] = { -- This Example of a target/aoe and targetAoe Turrent [Define by lookType]
        combat = {
            [1] = {attackType = "target", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {30, 60}, magicEffect = CONST_ME_FIREAREA, shootEffect = CONST_ANI_FIRE},
            [2] = {attackType = "targetAoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = burstArrowArea, dmgValues = {60, 80}, magicEffect = CONST_ME_HOLYAREA, shootEffect = CONST_ANI_ENERGY},
            [3] = {attackType = "aoe", combatType = COMBAT_PHYSICALDAMAGE, combatArea = 0, dmgValues = {80, 90}, magicEffect = CONST_ME_MORTAREA, shootEffect = CONST_ANI_SUDDENDEATH}
        },
        cfg = {
            turretName = "Mage Tower",
            [1] = {buildPrice = 120, sellPrice = 60, upgradePrice = 400, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 2000},
            [2] = {sellPrice = 280, upgradePrice = 600, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 1500},
            [3] = {sellPrice = 400, upgradePrice = 0, rangeX = 6, rangeY = 6, colorId = 65, attackSpeed = 1000}
        }
    }
}
......................................code on bottom....................
......................
..................
................
OOps my bad lol.
But yeah :)awsome share hehe

Stupid double post >.<
 
Last edited by a moderator:
How can i set for mages not to be able to use mana shield? they go in there and use mana shield and they dont die as quickly
 
Back
Top