Kodak
Member
- Joined
- Jun 7, 2007
- Messages
- 36
- Reaction score
- 6
So I wrote this script using some info I found here on the forums.
In theory, it should work as,
If Level 20 & No storage value then
If Knight/Elite Knight then
If Axe > then Sword & Club, give axe weapon
Else if Sword > Axe & Club then give sword weapon
Else if Club > Sword & Axe then give club weapon
If Sorc/MS then give Wand
If Druid/ED then give Rod
If Paladin/RP then give spear,
along with adding storage and a message with each.
Currently it only sets storage value, and sets it to 62, no 1 for some reason, with no weapon given or message shown.
Figure another set of eyes would help. Used as a creature script:
In theory, it should work as,
If Level 20 & No storage value then
If Knight/Elite Knight then
If Axe > then Sword & Club, give axe weapon
Else if Sword > Axe & Club then give sword weapon
Else if Club > Sword & Axe then give club weapon
If Sorc/MS then give Wand
If Druid/ED then give Rod
If Paladin/RP then give spear,
along with adding storage and a message with each.
Currently it only sets storage value, and sets it to 62, no 1 for some reason, with no weapon given or message shown.
Figure another set of eyes would help. Used as a creature script:
Lua:
function onAdvance(cid, oldLevel, newLevel)
if getPlayerLevel(cid) >= 20 and getPlayerStorageValue(cid, 8141) == -1 then
if player:getVocation() == 4 or player:getVocation() == 8 then
if player:getSkillLevel(cid, SKILL_AXE) > player:getSkillLevel(cid, SKILL_SWORD) and player:getSkillLevel(cid, SKILL_AXE) > player:getSkillLevel(cid, SKILL_CLUB) then
player:addItem(2429, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a barbarian axe. Thank you for playing.")
elseif player:getSkillLevel(cid, SKILL_CLUB) > player:getSkillLevel(cid, SKILL_SWORD) and player:getSkillLevel(cid, SKILL_CLUB) > player:getSkillLevel(cid, SKILL_AXE) then
player:addItem(2423, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a clarical mace. Thank you for playing.")
elseif player:getSkillLevel(cid, SKILL_SWORD) > player:getSkillLevel(cid, SKILL_CLUB) and player:getSkillLevel(cid, SKILL_SWORD) > player:getSkillLevel(cid, SKILL_AXE) then
player:addItem(2383, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a spike sword. Thank you for playing.")
end
elseif player:getVocation() == 1 or player:getVocation() == 5 then
player:addItem(2189, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a wand of cosmic energy. Thank you for playing.")
elseif player:getVocation() == 2 or player:getVocation() == 6 then
player:addItem(2185, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a necrotic rod. Thank you for playing.")
elseif player:getVocation() == 3 or player:getVocation() == 7 then
player:addItem(2429, 1)
player:addStorage(8141, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have received a hunting spear. Thank you for playing.")
end
end
return true
end
function onLogin(player)
player:registerEvent("onadvance_reward3")
return true
end