• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

New Idea - Blessings (onPrepareDeath)

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
It is possible to make a script where if the player dies by monsters nothing happens? Do not lose level, equipment, etc.
And if he dies by a player he loses level and equipment ...

onPrepareDeath idea:
Add Bless - (if the killer is a monster)
Remove Bless - (if the killer is a player)
 
Last edited:
Or an other idea with function onKill:
Code:
function onKill(cid, target)
    if isPlayer(cid) == true and isPlayer(target) == true then
      -- bless off
    elseif isPlayer(cid) == false and isPlayer(target) == true then
      -- bless on
    end
  return true
end
 
Will work?
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(lastHitKiller) == true then
      doCreatureSetDropLoot(cid, 10)
      doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10)
    else
      doCreatureSetDropLoot(cid, 0)
      doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
    end
  return true
end
 
Back
Top