Nokturno
Not a human
- Joined
- Aug 7, 2009
- Messages
- 606
- Solutions
- 2
- Reaction score
- 422
Hello Otlanders.
Well i hope someone can help me with this one.
can someone fix this scripts cuz it have some Mistakes.
Cuz i edited And now is not working LOL
Console ERROR
RankName Script
Well i hope someone can help me with this one.
can someone fix this scripts cuz it have some Mistakes.
Cuz i edited And now is not working LOL
Console ERROR
Code:
Warning: [Event::checkScript] Can not load script. /scripts/SetRank.lua
[27/08/2011 12:05:38] data/creaturescripts/scripts/SetRank.lua:104: 'end' expected (to close 'function' at line 86) near '<eof>'
RankName Script
Code:
local config = {
storage = 7500,
mailbox = {
{x = 95, y = 112, z = 7}
}
}
local ranks = {
[" The Scout"] = {
c = {
level = 20,
prize = {2160, 1}
}
},
["Grunt"] = {
c = {
level = 30,
prize = {2160, 2}
}
},
["Sergeant"] = {
c = {
level = 40,
prize = {2160, 4}
}
},
["Senior Sergeant"] = {
c = {
level = 50,
prize = {2160, 5}
}
},
["Master Sergeant"] = {
c = {
level = 55,
prize = {2160, 6}
}
},
["Legionnaire"] = {
c = {
level = 60,
prize = {2160, 7}
}
},
["Lieutenant General"] = {
c = {
level = 70,
prize = {2160, 8}
}
},
["General"] = {
c = {
level = 80,
prize = {2160, 9}
}
},
["War Lord"] = {
c = {
level = 85,
prize = {2160, 10}
}
},
}
local function doPlayerAddDepotItems(cid, pos, town, items, notify) -- credits to Chojy for idea.
local parcel = doCreateItemEx(2595)
local label = doAddContainerItem(parcel, 2599)
doSetItemText(label, getCreatureName(cid) .."\n".. town)
doAddContainerItemEx(parcel, items)
doTeleportThing(parcel, pos)
if(notify == true) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your reward has been sent to your depot because you were unable to carry it.")
end
return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
for desc, i in pairs(ranks) do
if skill == SKILL__LEVEL then
if newLevel >= i.c.level then
if getCreatureStorage(cid, config.storage) < newLevel then
local id = doCreateItemEx(i.c.prize[1], i.c.prize[2] or 1)
if(doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR) then
doPlayerAddDepotItems(cid, config.mailbox[1], getTownName(getPlayerTown(cid)), id, true)
end
doCreatureSetStorage(cid, config.storage, newLevel)
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
doCreatureSay(cid, "Congratulations! You are now a ' ... desc .. '.", TALKTYPE_MONSTER)
break
end
end
end
end
Last edited: