NPC Miles daje mo?liwo?? tworzenia sobie item?w potrzebnych do eq, po przez co? w stylu task. Czyli wybierasz np. Demon armor, po czym NPC daje ci taki dialog - "You don't have all you need to craft Demon Armor. You need 100 x Red Pieces of Cloth which can be looted from Hero and 50 x Demon Dust which can be looted from Demon. The cost of crafting is 1 cystal coin." Gdy ju? zbierzesz potrzebne itemy podchodzisz zn?w do NPC i piszesz zn?w nazwe tego itemu, po czym NPC zabiera ci itemy kt?re zebra?e? i daje ci item kt?ry chcesz kt?ry w tym przypadku jest Demon Armor.
Dodawanie item?w jest bardzo proste, dodajesz do tablicy:
Nie mam jak przetestowa? skrypt wi?c nie mam poj?cia czy dzia?a. Je?li co? jest nie tak to prosz? tu pisa?, spr?buje pom?c.
Autorem skryptu jestem ja, zabraniam wstawiania na inne fora bez mojej zgody.
Stw?rz plik xml o nazwie Miles
A p??niej lua o nazwie Miles
Dodawanie item?w jest bardzo proste, dodajesz do tablicy:
Code:
[[COLOR="#800000"]3888[/COLOR]] = { Name = "[COLOR="#8B4513"]Demon Armor[/COLOR]", Item = [COLOR="#800000"]3888[/COLOR], ItemToBring = "[COLOR="#2F4F4F"]Red Piece of Cloth[/COLOR]", AmountToBring = [COLOR="#008080"]100[/COLOR], LootedIn = "[COLOR="#000080"]Hero[/COLOR]", ItemToBring2 = "[COLOR="#4B0082"]Demon Dust[/COLOR]", AmountToBring2 = [COLOR="#696969"]50[/COLOR], LootedIn2 = "[COLOR="#B22222"]Demon[/COLOR]", Cost = [COLOR="#A52A2A"]1[/COLOR] }
Code:
[COLOR="#800000"]Item ID[/COLOR]
[COLOR="#8B4513"]Nazwa itemu[/COLOR]
[COLOR="#2F4F4F"]Jaki item trzeba przynie??[/COLOR]
[COLOR="#008080"]Ile trzeba przynie??[/COLOR]
[COLOR="#000080"]Sk?d wzi???[/COLOR]
[COLOR="#4B0082"]Jaki drugi item trzeba przynie??[/COLOR]
[COLOR="#696969"]Ile trzeba przynie??[/COLOR]
[COLOR="#B22222"]Sk?d wzi???[/COLOR]
[COLOR="#A52A2A"]Cena w CC[/COLOR]
Nie mam jak przetestowa? skrypt wi?c nie mam poj?cia czy dzia?a. Je?li co? jest nie tak to prosz? tu pisa?, spr?buje pom?c.
Autorem skryptu jestem ja, zabraniam wstawiania na inne fora bez mojej zgody.
Stw?rz plik xml o nazwie Miles
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Miles" script="Miles.lua">
<health now="100" max="100"/>
<look type="289" head="115" body="131" legs="106" feet="131" addons="2"/>
</npc>
A p??niej lua o nazwie Miles
Code:
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
local Possible {
[3888] = { Name = "Demon Armor", Item = 3888, ItemToBring = "Red Piece of Cloth", AmountToBring = 100, LootedIn = "Hero", ItemToBring2 = "Demon Dust", AmountToBring2 = 50, LootedIn2 = "Demon", Cost = 1 }
}
local Craft = Possible[itemid]
NpcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|, name the item that you would like me to craft for you.")
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, Craft.Name)) then
talkState[talkUser] = 1
npcHandler:say("Are you sure you would like to craft " ...Craft.Name... "?", cid)
elseif(msgcontains(msg, "yes")) then
if(talkState[talkUser] == 1) then
if(doPlayerRemoveItem(cid, Craft.ItemToBring, Craft.AmountToBring) and doPlayerRemoveItem(cid, Craft.ItemToBring2, Craft.AmountToBring2) and doPlayerRemoveItem(cid, 3043, 1)) then
npcHandler:say("Oh great! You brought all of the items needed to craft " ...Craft.Name... "!", cid)
npcHandler:say("Here is your " ...Craft.Name... ".", cid)
doPlayerAddItem(cid, Craft.Item, 1)
else
npcHandler:say("You don't have all you need to craft " ...Craft.Name... ". You need " ...Craft.AmountToBring... "x" ...Craft.ItemToBring... "which can be looted from" ...Craft.LootedIn... "and " ...Craft.AmountToBring2... "x" ...Craft.ItemToBring2... "which can be looted from" ...Craft.LootedIn2... ". The cost of crafting is 1 crystal coin.", cid)
end
talkState[talkUser] = 0
end
end
elseif(msgcontains(msg, "bye")) then
npcHandler:say("Goodbye |PLAYERNAME|!", cid)
else npcHandler:say("How rude...", cid)
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())