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

Lua invencible

Status
Not open for further replies.

Caio Cesar

Member
Joined
Nov 23, 2014
Messages
60
Reaction score
6
Location
Brazil - Goiânia
I searched in otland, but found nothing about it.
Have any function or way to make player invencible for x seconds?
If yes, would like edit it to be random chances for sucess, like:

Cast spell: Invincibility
Chance to success 20-50%, 5 seconds invencible :)
 
It would be super easy in the source, might just work with LUA. What server version are you using?

Ignazio
 
Not perfectly certain how it works, but there is a creature event called "healthchange", you could try something like this:

Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
  if (creature:getStorageValue(1000) == 1) then)
    return 0
  else
    return primaryDamage, primaryType, secondaryDamage, secondaryType
  end
end

... and in the xml file (creaturescripts):
Code:
<event type="healthchange" name="HealthChange" script="healthchange.lua"/>

and then set the storage value in the spell (1000), or if you use cstom conditons, that's up to you.

It might work, have a go.

Ignazio
 
Status
Not open for further replies.
Back
Top