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

TalkAction [TFS1.2] Colors revive system - Revive Spell

strutZ

Australian OT Member {AKA Beastn}
Joined
Nov 16, 2014
Messages
1,391
Solutions
7
Reaction score
550
Here is the talkaction script I made that will revive a player when killed. This script requires @Colors REVIVE SYSTEM to work. All you need to do is configure the top half of the script. No need to touch anything else.

Enjoy.

data/talkactions/talkactions.xml

Code:
    <talkaction words="return" separator=" " script="revive_spell.lua" />

data/talkactions/scripts/revive_spell.lua


Code:
-- CONFIG --
local deathGroupId = 4 -- Add your death ID from your revive script here
local cost = 80 -- Add the spell mana cost here
local vocs = {2, 6} -- Add the vocation numbers you want to be able to use the spell.
local cooldown = 30 -- Add your cooldown in seconds.
-- END CONFIG --


-- CORE CODE --
function onSay(player, words, param)
    local target = Creature(param)
   
    if not target then
        player:sendCancelMessage("A player with this name cannot be found.")
        return false
    end

    if isInArray(vocs, player:getVocation():getId()) then
        if player:getStorageValue(987654) >= os.time() then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are still drained from your last revive!")
            return false
        end
            if player:getMana() < cost then
                player:sendCancelMessage("You dont have enough mana.")
                return false
            else
                if target:getGroup():getId() == deathGroupId then
                    target:applyDeathAttributes(false)
                    target:removeCondition(CONDITION_OUTFIT)
                    target:addHealth(target:getMaxHealth())
                    target:addMana(target:getMaxMana())
                    player:addMana(-cost)
                    player:setStorageValue(987654, os.time() + cooldown)
                    return true
                end
            end
        else
            player:sendCancelMessage("Only Druids can cast this spell.")
            return false
        end
    end

CREDITS
@RazorBlade
@Colors
 
as an AION Cleric, I approve

will use this script as a base for my own system one day :)
 
make it cost more like 30% of max mp so druids won't get op
 
make it cost more like 30% of max mp so druids won't get op
its set to 8k on my server. also can only be used by level 300 or higher. I can make it use % if you want though
 
Back
Top