president vankk
Web Developer & AuraOT Owner
- Joined
- Jul 10, 2009
- Messages
- 5,719
- Solutions
- 9
- Reaction score
- 339
I would like is a script that if you give use it, you become master sorcerer and so on.
rep+
eace:
rep+
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
--[[
local node2 = keywordHandler:addKeyword({'epic'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can epicize you for 200000 gold coins. Do you want me to epicize you?'})
node2:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 200000, level = 120, promotion = 2, text = 'Congratulations! You are now epicized.'})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})
]]--
npcHandler:addModule(FocusModule:new())
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPremium(cid) == false then
doPlayerSendCancel(cid,"You must have PACC.")
return true
end
if isPremium(cid) == true and getPlayerLevel(cid) >= 20 then
if getPlayerPromotionLevel(cid) == 0 then
setPlayerPromotionLevel(cid, 1)
doCreatureSay(cid,"You are now Promoted.",TALKTYPE_ORANGE_1)
doSendMagicEffect(getPlayerPosition(cid),19)
return true
end
if getPlayerPromotionLevel(cid) > 0 then
doPlayerSendCancel(cid,"You are already promoted.")
return true
end
end
local t = {
premium = true,
level = 20,
effect = CONST_ME_SOUND_RED
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if t.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "You must have a premium account.")
elseif getPlayerLevel(cid) < t.level then
doPlayerSendCancel(cid, "You need level " .. t.level .. " or higher.")
elseif getPlayerPromotionLevel(cid) > 0 then
doPlayerSendCancel(cid,"You are already promoted.")
else
setPlayerPromotionLevel(cid, 1)
doCreatureSay(cid, "You are now promoted.", TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(cid), t.effect)
end
return true
end
<action itemid="[COLOR="Red"]xxxx[/COLOR]" event="script" value="promotion.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPromotionLevel(cid) == 0 then
if isPremium(cid) then
if getPlayerLevel(cid) >= 20 then
doPlayerSetPromotionLevel(cid, 1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Now you are promoted.");
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need level 20 or higher.")
return true
end
else
doPlayerSendCancel(cid,"You need premium to get promotion.")
return true
end
else
doPlayerSendCancel(cid, "You are already promoted.")
return true
end
end