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

Special Aol ~Request~

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
I need a Forever Blessed aol?
I Want to it stays forever but wher RS kill i want to player loss Forever Blessed aol?


Rep++Back
 
Lua:
local bless = {1, 2, 3, 4, 5}
local AMULET_ID = 2173 
 
function onPrepareDeath(cid)
if getPlayerSlotItem(cid, 2).itemid == AMULET_ID then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendTextMessage(cid,24, "Your amulet of loss gave you blessings.")
        doSendMagicEffect(getPlayerPosition(cid), 28)
    end
    return TRUE
end
 
Lua:
local bless = {1, 2, 3, 4, 5}
local amulet_id = 2173 
 
function onpreparedeath(cid)
if getplayerslotitem(cid, 2).itemid == amulet_id then
        for i = 1, table.maxn(bless) do
            doplayeraddblessing(cid, bless[i])
        end
        doplayersendtextmessage(cid,24, "your amulet of loss gave you blessings.")
        dosendmagiceffect(getplayerposition(cid), 28)
    end
    return true
end


you are awesome!!!! Rep++

- - - Updated - - -

Wher to put this Action??
I dont see onuse??
 
Unlike actions, creaturescripts have alot of different functions, so you have to add the type in the xml line, like this:
XML:
<event type="preparedeath" name="Bless" event="script" value="blessaol.lua"/>

Also all not login creaturescripts should be registered in login.lua with the name you use in the xml line, so like this:
Lua:
registerCreatureEvent(cid, "Bless")
You can add it under the other registerCreatureEvent lines.
 
Lua:
local bless = {1, 2, 3, 4, 5}
local AMULET_ID = 2173 
 
function onPrepareDeath(cid)
if getPlayerSlotItem(cid, 2).itemid == AMULET_ID then
        for i = 1, table.maxn(bless) do
            doPlayerAddBlessing(cid, bless[i])
        end
        doPlayerSendTextMessage(cid,24, "Your amulet of loss gave you blessings.")
        doSendMagicEffect(getPlayerPosition(cid), 28)
    end
    return TRUE
end


Limos I just Test The Script AND IT DON'T WORK!!!!And i giv u rep++
I dont Get anything server just crash!!!!!!!!!HELP!!!!!
 
I used Limos' script but there's a problem. When a character gets killed by a monster the client crashes with a debug assertion. Players doesn't lose items or skills or experience, script works fine, the only problem is it crashes client. How can I fix this issue? I use Mystic Spirit 0.2.15 if that helps.

Here's a copy of the debug assertion:
Code:
Last Packet Types: 180 134 109 109 180 131 106 108 140 160
Last Packet: 109 093 000 117 000 007 002 094 000 117 000 007 134 175 006 000
Player Position: [95,117,7]
Player Name: Test Sorc (xxxxxxxxx)
Player Action: 049 050 055 046 048 046 048 046 049 058 055 049 055 050
Player.cpp 343: exception occurred, reason:
Network.cpp 979: exception occurred (ErrorCode = 0), reason:
Control.cpp 1496: exception occurred (Type = 180) (MainWindow = 58683720), reason:
Communication.cpp 3641: exception occurred (ChatMessageMode = 24), reason:
Network.cpp 515: exception occurred (MaxLength = 4096), reason:
Utils.cpp 548: assertion failed (Position = 40) (Size-Length = -25689), reason:
Position<=Size-Length

Thanks for your help!
 
It's the textmessage type that makes the client crash, Mystic Spirit uses different numbers then Crying Damson.
Use instead of 24, MESSAGE_STATUS_DEFAULT or 16.
Or if you want to use different message types.
Lua:
MESSAGE_STATUS_CONSOLE_BLUE = 4
MESSAGE_STATUS_CONSOLE_RED = 12
MESSAGE_STATUS_DEFAULT = 16
MESSAGE_STATUS_WARNING = 17
MESSAGE_EVENT_ADVANCE = 18
MESSAGE_STATUS_SMALL = 19
MESSAGE_INFO_DESCR = 20
MESSAGE_EVENT_DEFAULT = 28
MESSAGE_EVENT_ORANGE = 34
MESSAGE_STATUS_CONSOLE_ORANGE = 35
 

Similar threads

Back
Top