Elf
Sing blue silver
- Joined
- Apr 12, 2008
- Messages
- 409
- Reaction score
- 50
- Age
- 33
Wrzuci?em jaki? czas temu na otland.net, to i tu przy okazji wrzuc?
storage <- chyba nie musz? wyja?nia?
experience <- ilo?? otrzymanego do?wiadczenia za wykonanie
axe, club, sword <- numery broni
//Sinner
Dodane tagi.
Code:
local config = {
storage = 5019,
experience = 400,
axe = 2429,
club = 2394,
sword = 2409
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE) then
return TRUE
end
if(getPlayerStorageValue(cid, config.storage) ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
return TRUE
end
local club = getPlayerSkill(cid, 1)
local sword = getPlayerSkill(cid, 2)
local axe = getPlayerSkill(cid, 3)
local reward = 0
if(axe > sword and axe > club) then
reward = doCreateItemEx(config.axe, 1)
elseif(club > sword and club > axe) then
reward = doCreateItemEx(config.club, 1)
elseif(sword > club and sword > axe) then
reward = doCreateItemEx(config.sword, 1)
end
if(reward == 0) then
doPlayerSendCancel(cid, "Sorry, you have to choose a weapon type first.")
elseif(doPlayerAddItemEx(cid, reward, FALSE) ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a reward weighing " .. getItemWeight(reward) .. " oz. It is too heavy or you have not enough space.")
else
local tmp = getItemDescriptions(reward)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. tmp.article .. " " .. tmp.name .. ".")
setPlayerStorageValue(cid, config.storage, 1)
doPlayerAddExp(cid, config.experience)
doSendAnimatedText(getCreaturePosition(cid), config.experience, TEXTCOLOR_WHITE_EXP)
end
return TRUE
end
experience <- ilo?? otrzymanego do?wiadczenia za wykonanie
axe, club, sword <- numery broni
//Sinner
Dodane tagi.
Last edited by a moderator: