Postado Setembro 3, 2015 9 anos Bom gostaria que esse npc heala-se 100% a vida do player que falar com ele (LIFE FULL), desse bless custando 2crystal porem a cada 30 leveis que player upar aumenta-se 2 crystal (bless so a partir do lvl 40), aol custa-se apenas 2 crystal e vendesse 1 dia de premium account por 3 crystal coins OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!
Postado Setembro 30, 2015 9 anos Autor up OldTaboos24hpor48h.com Inauguração DOMONIGO as 18:00 | 18/03/2018 | Stages | Custom Map |VENHA SER TOP TABOOS!
Postado Setembro 30, 2015 9 anos Solução Na pasta npc cria um arquivo Gabriel.xml e bota isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Gabriel" script="data/npc/scripts/Gabriel.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="134" head="55" body="60" legs="50" feet="75" addons="3"/> <parameters> <parameter key="message_greet" value="Olá |PLAYERNAME|. Fale {trade} para ver minhas ofertas, {bless} para compra bless somente acima do level {40}, {premium} para compra 1 dia de premium account." /> <parameter key="message_decline" value="Adeus, |PLAYER NAME|." /> <parameter key="message_walkaway" value="Adeus, |PLAYER NAME|." /> <parameter key="module_keywords" value="1" /> <parameter key="keywords" value="bless;premium;" /> <parameter key="keyword_reply1" value="{first bless},{second bless},{third bless},{third bless},{fifth bless}" /> <parameter key="keyword_reply2" value="Eu troco varios itens como: ferramentas e itens necessários interessantes" /> <parameter key="shop_buyable" value="Amulet of Loss,2173,200000;"/> </parameters> </npc> Vai em npc/scripts/ e cria um arquivo chamado Gabriel.lua e bota isso: 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'offer') or msgcontains(msg, 'price')) then selfSay('Eu posso lhe dar 1 dias de premium por 2 crystal coins.', cid) elseif(msgcontains(msg, 'premium') or msgcontains(msg, 'Premium')) then selfSay('Você gostaria de comprar 1 dias de premium?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if(doPlayerRemoveItem(cid, 2160, 2) == true) then selfSay('Muito bem! Aproveite!', cid) doPlayerAddPremiumDays(cid, 1) talkState[talkUser] = 0 elseif(doPlayerRemoveItem(cid, 2152, 200) == true) then selfSay('Muito bem! Aproveite!', cid) doPlayerAddPremiumDays(cid, 1) talkState[talkUser] = 0 elseif(doPlayerRemoveItem(cid, 2148, 20000) == true) then selfSay('Muito bem! Aproveite!', cid) doPlayerAddPremiumDays(cid, 1) talkState[talkUser] = 0 else selfSay('Desculpe, você não tem o {valor} necessário parar comprar uma premium.', cid) talkState[talkUser] = 0 end end return TRUE end local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 2000 (plus level depending amount) gold?'}) node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 40, endLevel = 200}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'}) local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 2000 (plus level depending amount) gold?'}) node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 40, endLevel = 200}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'}) local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 2000 (plus level depending amount) gold?'}) node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 40, endLevel = 200}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'}) local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?'}) node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 200000, levelCost = 6666, startLevel = 40, endLevel = 200}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'}) local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?'}) node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 200000, levelCost = 666, startLevel = 40, endLevel = 200}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'}) npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) @Edit não testei qualquer error so fala... Editado Setembro 30, 2015 9 anos por jobsonmb (veja o histórico de edições) Que Ajuda? Me Contate. Sou: Programador Script Mapper WebMaster WebDesigner E Muito Mais Você tem o direito de falar o que pensaMas não tem o direito de julgar quem não conheceLiberdade de expressão é um direito de todosMas em vez de falar, então faça algo que preste ~Charlie Brown Jr
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.