Smix
No caso, seu script verifica se o player possui o amulet e se possuir a storage vip ou premiumdays, adiciona a nova porcentagem de exp ao morrer, no caso 80%.
Quorra
No caso se possuir a storage vip/premiumdays (dependendo do seu sistema), você quer que o player free red skull com o amulet perca 80% da exp e se for vip/p.a perca 50%, certo ? O mesmo para o black skull só que 30% (free) e 10% (vip/p.a).
Aproveitando o script do Smix, se me permite...
Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado redamulet.lua
Adicione o script:
local config = {
amulet = 1111,
vipSystem = "enabled",
vipStorage = 2222,
premium = "enabled",
newLossPercent = 80,
vipLossPercent = 50,
}
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller, deathList)
if not isPlayer(cid) then
return true or 0
end
if (getPlayerItem(cid, config.amulet) == 1) and getPlayerSkullType(cid) >= 4 then
if (getPlayerStorageValue(cid, config.vipStorage) >= 1) and getPlayerPremiumDays(cid) >= 1 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, config.vipLossPercent)
doCreatureSetDropLoot(cid, false)
elseif(config.premium == "disabled" and config.vipSystem == "disabled" and getPlayerPremiumDays(cid) <= 0) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, config.newLossPercent)
doCreatureSetDropLoot(cid, false)
end
return true
end
end
Vermelho: ItemID do amuleto.
Amarelo: Se o Vip System está enabled (habilitado) disabled (desabilitado).
Roxo: StorageID de seu Vip System.
Azul: Se a Premium Account está enabled (habilitado) disabled (desabilitado).
Verde: Porcentagem de perda de Exp Free como Red Skull.
Rosa: Porcentagem de perda de Exp Vip/P.A como Red Skull.
Abra o arquivo login.lua da mesma pasta (data/creaturescripts/scripts) e adicione a linha script junto as outras:
registerCreatureEvent(cid, "RedSkullAmulet")
Agora volte a pasta data/creaturescripts e abra o arquivo creaturescripts.xml
Adicione a tag:
<event type="death" name="RedAmulet" event="script" value="redamulet.lua"/>
Para fazer Black Skull Amulet, apenas troque a parte:
getPlayerSkullType(cid) >= 4 then
por:
getPlayerSkullType(cid) >= 5 then
e reconfigure com sua preferência.