Majster12
Member
- Joined
- Feb 20, 2009
- Messages
- 134
- Solutions
- 1
- Reaction score
- 16
Code:
function onEquip(cid, item, slot)
local messages = {
{m = "The ring feels quite heavy now. Nothing else happens.", e = CONST_ME_MAGIC_GREEN},
{m = "The ring feels even heavier. You feel slightly stronger, however.", e = CONST_ME_MAGIC_GREEN},
{m = "You feel better, more energetic than ever before. The ring seems to wrap itself tighter around your finger."},
{m = "The ring now cuts your flesh. However, you feel fast as lightning and strong as a dragon, fires seem to burn within you."},
{m = "You feel as if you could touch the stars and see beyond even the dimmest of them. The ring hurts you now.", e = CONST_ME_MAGIC_GREEN},
{m = "The ring now seems to be as hot as fire while at the same time cold as ice. Put it off or it will seriously hurt you."},
{m = "Pain is no word for what you feel anymore. If you do not put the ring off it MAY kill you. Chances are 50/50.", e = CONST_ME_FIREWORK_YELLOW},
{m = "Your pain transports you in a different world, you are alone there. Filled with anguish. You may live or it MAY KILL YOU."},
{m = "You became pain itself. You are mere seconds away from death. If you do not PUT OFF THE RING. You MAY actually DIE.", e = CONST_ME_MORTAREA}
}
local function endRing(cid)
local chance = math.random(1, 2)
if chance == 1 then
doPlayerAddItem(cid, 22516, 1)
else
doCreatureAddHealth(cid, -getCreatureHealth(cid))
end
doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_RING).uid, 1)
return true
end
--
local time = 0
for m = 1, #messages do
addEvent(doPlayerSendTextMessage, time, cid, MESSAGE_EVENT_ADVANCE, messages[m].m)
if messages[m].e then
addEvent(doSendMagicEffect, time, getPlayerPosition(cid), messages[m].e)
end
time = time + 5000
end
addEvent(endRing, #messages * 5000, cid)
return true
end
The text should be displayed once.