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

Spell IMMORTAL SPELL

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
HI
If not working please write errors!

-add line spells.xml

Lua:
    <instant group="support" spellid="144" name="Immortal" words="Immortal" lvl="1" mana="1" aggressive="0" selftarget="1" cooldown="1000" groupcooldown="1000" needlearn="0" script="immortal.lua">
    </instant>

---create lua data/spells/immortal.lua

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 63)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)


function onCastSpell(creature, variant, isHotkey)
local player = Player(creature)
    if not player then
        return
    end
   local function INV()
   local player = Player(creature)
       if not player then
        return
    end
     player:setGroup(Group(1))
         return true
  end
    addEvent(INV, 5000)   
    player:setGroup(Group(5))
   
    return combat:execute(creature, variant)
end


--- addEvent(INV, 5 * 1000) -----Duration immortal

--- add this line to you login.lua


This is protection for forever IMMORTAL.

Lua:
if player:getGroup():getId() == 5 then
     player:setGroup(Group(1))
end


---and last add NEW group in you data/XML/groups.xml

Lua:
    <group id="5" name="IMMORTAL" flags="8" access="0" maxdepotitems="0" maxvipentries="0" />


Let's Tested!
:D
 
You could make that simplier just with adding a storage and a few lines at events
 
How can i solve this?, [7/4/2020 19:13:0] data/spells/scripts/immortal.lua:1: attempt to call global 'Combat' (a nil value)

also I dont know at what line I have to add at login.lua
[7/4/2020 19:13:4] [Error - Test Interface]
[7/4/2020 19:13:4] data/creaturescripts/scripts/login.lua
[7/4/2020 19:13:4] Description:
[7/4/2020 19:13:4] data/creaturescripts/scripts/login.lua:1: attempt to index global 'player' (a nil value)
[7/4/2020 19:13:4] [Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/login.lua)

TFS 1.0
 
Back
Top