• 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 like sussano in Naruto

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello,
someone can made a spell who:



-When active you dont recive any damage
-When active you lose 2% of your total hp/s
-When active you have some unique id (i wanna make you cannot use a potion when spell active)
- -||- -100 speed (optional)
- -||- send a magic effect (11) in front of you
-If you have 5% or less hp spell turn off (and you cannot on that spell)
-You can turn on/off the spell (with the same word)



If someone made that script that will be great :)


Thanks,
Erexo.
 
Untested, but should work...
Lua:
local storage_value = 1337 --storage value to use
local turn_on_effect = CONST_ME_TELEPORT
local turn_off_effect = CONST_ME_POFF
local percent_per_second = 0.02
local percent_to_stop = 0.05

local function upkeepSpell(cid)
   if(getPlayerStorageValue(cid, storage_value) == 1) and (getCreatureHealth(cid) > (percent_to_stop * getCreatureMaxHealth(cid))) then
      doCreatureAddHealth(cid, -(percent_per_second * getCreatureMaxHealth(cid)))
      doSendDistanceShoot(getCreaturePosition(cid), getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), CONST_ANI_LARGEROCK)
      return addEvent(upkeepSpell, 1000, cid)
   else
      turnOff(cid)
   end
   return true
end

local function turnOn(cid)
   doPlayerSetStorageValue(cid, storage_value, 1)
   doSendMagicEffect(getCreaturePosition(cid), turn_on_effect)
   return upKeepSpell(cid)
end

local function turnOff(cid)
   doPlayerSetStorageValue(cid, storage_value, -1)
   doSendMagicEffect(getCreaturePosition(cid), turn_off_effect)
   return true
end

onCastSpell(cid, var)
   if (getPlayerStorageValue(cid, storage_value) == -1) then
      turnOn(cid)
   else
      turnOff(cid)
   end
   return true
end

Add invincibility into your creaturescripts with the storage you used, and add this to your manarune:
Lua:
if(getPlayerStorageValue(cid, 1337) == 1) then
   return false
end
 
Back
Top