JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
data/creaturescripts/scripts/login.lua
data/creaturescripts/creaturescripts.xml
data/creaturescripts/scripts/reward.lua
Example: What it should look like.
Regards,
JDB.
Code:
registerCreatureEvent(cid, "AdvanceReward")
data/creaturescripts/creaturescripts.xml
Code:
<event type="preparedeath" name="AdvanceReward" event="script" value="[COLOR="red"]reward.lua[/COLOR]"/>
data/creaturescripts/scripts/reward.lua
Code:
local items = {
[25] = {
{ITEM, COUNT, STORAGE}
},
[50] = {
{ITEM, COUNT, STORAGE}
},
[100] = {
{ITEM, COUNT, STORAGE}
}
}
function onAdvance(cid, skill, oldLevel, newLevel)
local v = items[newLevel]
return v and getPlayerStorageValue(cid, v[3]) == -1 and doPlayerAddItem(cid, v[1], v[2] or 1) and setPlayerStorageValue(cid, v[3], 1)
end
Example: What it should look like.
Code:
{[COLOR="red"]2160, 100, 1337[/COLOR]}
Regards,
JDB.
Last edited: