Old Sessam
Hello
- Joined
- Aug 5, 2009
- Messages
- 445
- Reaction score
- 56
Skrypt dedykuje konkurencji aby wszystko sprawdzili dok?adnie, co nie? Gantee :>
Ostatnio mi si? nudzi?o i nie mia?em co robi?, a pisz? tylko w CPP i mam ch?ci nauczenia si? lua jako i?, ?e, poniewa? zbli?aj? si? testy Exodum napisa?em prostego npc kt?ry
Instalacja
Wersja bez sprzedawania item?w
[XML]<?xml version="1.0" encoding="UTF-8"?>
<npc name="Testserver Assistant" script="testserver_assistant.lua" walkinterval="4000" floorchange="0">
<health now="100" max="100"/>
<look type="73" />
<parameters>
<parameter key="message_greet" value="Hey |PLAYERNAME|. I'm Testserver Assistant and can give {money} and {experience} which will be useful for testing on Exodum server."/>
<parameter key="message_farewell" value="Good bye!"/>
<parameter key="message_walkaway" value="Good bye!" />
</parameters>
</npc>
[/XML]
Wersja RL Tibia
[xml]
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Testserver Assistant" script="testserver_assistant.lua" walkinterval="4000" floorchange="0">
<health now="100" max="100"/>
<look type="73" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="Clay Lump,11339,1;
common costumebag,7737,1;
deluxe costumebag,7739,1;
uncommon costumebag,7738,1;
Fireworks Rocket,6576,1;
ice cube,7441,1;
Lottery Ticket,5957,1;
Party Trumpet,6572,1;
Piece of Marble Rock,11343,1;
Piggy Bank,2114,1;" />
<parameter key="message_greet" value="Hey |PLAYERNAME|. I'm Testserver Assistant and can give you {money} and {experience} which will be useful for testing on Exodum server."/>
<parameter key="message_farewell" value="Good bye!"/>
<parameter key="message_walkaway" value="Good bye!" />
<parameter key="message_sendtrade" value="I have donate items. Look!" />
</parameters>
</npc>
[/xml]
[LUA]--EXODUM OTS
--BY SZAFI (Old Sessam)
--http://tibia.net.pl/members/156613-Old-Sessam
--skype: sessam5
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
--DAWANIE 10 CRYSTAL COINS
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, "money") then
selfSay("Do you want 10 crystal coins?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
selfSay("Here you are.", cid)
doPlayerAddItem(cid, 2160, 10)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end
--DAWANIE 254237300 EXPA
elseif msgcontains(msg, "experience") then
selfSay("Do you want experience?", cid)
talkState[talkUser] = 2
elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 and getPlayerStorageValue(cid, 15211) == 1 then
selfSay("Sorry. Experience I can add only one time per character.", cid)
elseif
getPlayerStorageValue(cid, 15211) == -1 then
selfSay("Here you are.", cid)
doPlayerAddExp(cid, 254237300)
doCreatureSetStorage(cid, 15211, 1)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/LUA]
Customowa konfiguracja
Czerwony - ilos? expa ile ma dosta? gracz gdy poprosi o to npc.
Cyjan - Item ID przedmiotu (2160 to crystal coin inaczej 10k lub CC)
Zielony - Ile tego przedmiotu ma dosta?, np 10 sztuk po jednym 2160 czyli 10cc (100k)
Ostatnio mi si? nudzi?o i nie mia?em co robi?, a pisz? tylko w CPP i mam ch?ci nauczenia si? lua jako i?, ?e, poniewa? zbli?aj? si? testy Exodum napisa?em prostego npc kt?ry
- Daje 254237300 expa czyli 250 poziom, tylko jeden raz.
- Daje zawsze 10x crystal coin.
- Opis:
Instalacja
- /*/data/npc tworzymy pliczek o nazwie Testserver Assistant.xml dodajemy do niego zawarto??
Wersja bez sprzedawania item?w
[XML]<?xml version="1.0" encoding="UTF-8"?>
<npc name="Testserver Assistant" script="testserver_assistant.lua" walkinterval="4000" floorchange="0">
<health now="100" max="100"/>
<look type="73" />
<parameters>
<parameter key="message_greet" value="Hey |PLAYERNAME|. I'm Testserver Assistant and can give {money} and {experience} which will be useful for testing on Exodum server."/>
<parameter key="message_farewell" value="Good bye!"/>
<parameter key="message_walkaway" value="Good bye!" />
</parameters>
</npc>
[/XML]
Wersja RL Tibia
[xml]
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Testserver Assistant" script="testserver_assistant.lua" walkinterval="4000" floorchange="0">
<health now="100" max="100"/>
<look type="73" />
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="Clay Lump,11339,1;
common costumebag,7737,1;
deluxe costumebag,7739,1;
uncommon costumebag,7738,1;
Fireworks Rocket,6576,1;
ice cube,7441,1;
Lottery Ticket,5957,1;
Party Trumpet,6572,1;
Piece of Marble Rock,11343,1;
Piggy Bank,2114,1;" />
<parameter key="message_greet" value="Hey |PLAYERNAME|. I'm Testserver Assistant and can give you {money} and {experience} which will be useful for testing on Exodum server."/>
<parameter key="message_farewell" value="Good bye!"/>
<parameter key="message_walkaway" value="Good bye!" />
<parameter key="message_sendtrade" value="I have donate items. Look!" />
</parameters>
</npc>
[/xml]
- /*/data/npc/scripts tworzymy pliczek o nazwie testserver_assistant.lua dodajemy do niego zawarto??
[LUA]--EXODUM OTS
--BY SZAFI (Old Sessam)
--http://tibia.net.pl/members/156613-Old-Sessam
--skype: sessam5
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
--DAWANIE 10 CRYSTAL COINS
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, "money") then
selfSay("Do you want 10 crystal coins?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
selfSay("Here you are.", cid)
doPlayerAddItem(cid, 2160, 10)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end
--DAWANIE 254237300 EXPA
elseif msgcontains(msg, "experience") then
selfSay("Do you want experience?", cid)
talkState[talkUser] = 2
elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 and getPlayerStorageValue(cid, 15211) == 1 then
selfSay("Sorry. Experience I can add only one time per character.", cid)
elseif
getPlayerStorageValue(cid, 15211) == -1 then
selfSay("Here you are.", cid)
doPlayerAddExp(cid, 254237300)
doCreatureSetStorage(cid, 15211, 1)
talkState[talkUser] = 0
if(not npcHandler:isFocused(cid)) then
return false
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())[/LUA]
Customowa konfiguracja
Czerwony - ilos? expa ile ma dosta? gracz gdy poprosi o to npc.
Cyjan - Item ID przedmiotu (2160 to crystal coin inaczej 10k lub CC)
Zielony - Ile tego przedmiotu ma dosta?, np 10 sztuk po jednym 2160 czyli 10cc (100k)