O script é simples, para quem quiser dar uma inovada no servidor.. chega de first item creaturescript , vamos utilizar um npc
Em data/npcs/scripts crie um npc chamado firstitem.lua e cole o script a seguir
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME| I am a very rich person, and I'm donating my items you want? say {first item}.") function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local items = { [0] = { 8819, 8820}, [1] = { 8819, 8820}, [2] = { 8819, 8820}, [3] = { 2509, 2643}, [4] = { 2643, 2478 } } if msgcontains(msg, 'first item') or msgcontains (msg, 'first items') then if getPlayerStorageValue(cid,15003) < 1 then selfSay('You want the items? say {yes}', cid) talkState[talkUser] = 1 else selfSay('Sorry,I have given to you!', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then selfSay('You receive your items.', cid) doPlayerAddItem(cid, 2554, 1) doPlayerAddItem(cid, 2120, 1) doPlayerAddItem(cid, 2160, 2) for voca, item in pairs(items) do if getPlayerVocation(cid) == voca then for i = 1, table.maxn(items) do doPlayerAddItem(cid, items[i], 1) end setPlayerStorageValue(cid, 15003, 1) end end talkState[talkUser] = 0 else selfSay('Sorry,I have given to you!', cid) end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
agora data/nps crie um arquivo chamado Helper.xml(Formato XML, copie e cole se você não souber)
Editando os Items a Receber:
[0] = { 8819, 8820},
[1] = { 8819, 8820},
[2] = { 8819, 8820},
[3] = { 2509, 2643},
[4] = { 2643, 2478 }
Em [] são os ids das vocações
Ex: [0] = None
[1] = Sorcerer
Entre {} são os ids dos items.
Ex: {2160,2160,2160}
Sempre coloque uma virgula após o outro id.
Pronto, agora só ligar seu servidor ou dar /reload npc e rodar
