Nie tylko o Tibii i OTS...
Zbanowany
Cos mnie wziê³o i postanowi³em napisaæ skrypt który miejmy nadziejê ¿e uczyni wiele ots-ów ciekawszymi
otó¿ npc ten bêdzie kowalem !!
robimy plik kowal.lua a w nim
Spoiler:
--------------------------------------------------------------------------------------------
------------------------------------ Kowal ------------------------------------
--------------------------- Script by Uliczny Fighter --------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
addon_need_premium = 'Sorry, you need a premium account to get addons.'
addon_have_already = 'Sorry, you already have this addon.'
addon_have_not_items = 'Sorry, you don\'t have these items.'
addon_give = 'Here you are.'
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
if msgcontains(msg, 'kowal') then
selfSay('Wyrabiam golden helmet, Dragon scale legs i warlord sword.')
------------------------------------------------ golden helmet ------------------------------------------------
elseif msgcontains(msg, 'golden helmet') then
if isPremium(cid) then
if getPlayerItemCount(cid,6500) >= 100 and getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,6546) >= 1 then
selfSay('Czy masz 100 demonic essence, 100 piece of royal steel i dracola\'s eye?')
talk_state = 1
else
selfSay('Potrzebuje 100 demonic essence, 100 piece of royal steel i dracola\'s eye.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,6500) >= 100 and getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,6546) >= 1 then
if doPlayerTakeItem(cid,6500,100) == 0 and doPlayerTakeItem(cid,5887,100) == 0 and doPlayerTakeItem(cid,6546,1) == 0 then
doPlayerAddItem(cid,2471, 1)
end
else
selfSay(addon_need_premium)
end
------------------------------------------------ dragon scale legs ------------------------------------------------
elseif msgcontains(msg, 'dragon scale legs') then
if isPremium(cid) then
if getPlayerItemCount(cid,5920) >= 100 and getPlayerItemCount(cid,5877) >= 100 then
selfSay('Czy masz 100 smoczych skor i 100 zielonych smoczych lusek??')
talk_state = 2
else
selfSay('Potrzebuje 100 smoczych skor i 100 zielonych smoczych lusek.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,5920) >= 100 and getPlayerItemCount(cid,5877) >= 100 then
if doPlayerTakeItem(cid,5920,100) == 0 and doPlayerTakeItem(cid,5877,100) == 0 then
doPlayerAddItem(cid,2469, 1)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ Warlord sword ------------------------------------------------
elseif msgcontains(msg, 'warlord sword') then
if isPremium(cid) then
if getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,7390) >= 1 then
selfSay('Czy masz 100 piece of royal steel i justice seeker?')
talk_state = 3
else
selfSay('Potrzebuje 100 piece of royal steel i justice seeker.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,7390) >= 1 then
if doPlayerTakeItem(cid,5887,50) == 0 and doPlayerTakeItem(cid,7390,1) == 0 then
doPlayerAddItem(cid,2408, 1)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <=3) then
selfSay('Ok than.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
potem robimy plik kowal.xml i wklejamy
Spoiler:
<?xml version="1.0"?>
<npc name="Kowal" script="data/npc/scripts/kowal.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="131" head="114" body="114" legs="0" feet="114" addons="3"/>
</npc>
teraz opiszê jak on dzia³a otó¿ wyrabia nam 3 przedmioty
Dragon scale legs
warlord sword
golden helmet
teraz co trzeba miec aby dostac przedmiot
dragon scale legs-100 green dragon scale i 100 green dragon leather
golden helmet-100 piece of royal steel, 100 demonic essence i dragonla's eye
warlord sword- justice seeker i 100 piece of royal steel
dziala na aries z mapka evo
prosze o komentarze
ivelios
trudno zeby nick nie byl taki sam ;p
lecz przegladajac ten temat zobaczylem ze sie jednak rozni , moj jest to raczej ots for fun a nie rpg(chociaz kto wie) bazuje on na klasycznej wymianie przedmiotow. tamten z tego co przegladalem ma za zadanie sprawic aby gracz sam wykul przedmiot, wiec chyba jest roznica.
moze chociaz jeden ots stanie sie przez to urozmaicony
Pozdrawiam
Uliczny Fighter
Offline
Po 1 skrypt nie twój widzia³em go na innym forum.
tak jak my¶la³em by³ na innym forum.
Cos mnie wziê³o i postanowi³em napisaæ skrypt który miejmy nadziejê ¿e uczyni wiele ots-ów ciekawszymi
otó¿ npc ten bêdzie kowalem !!
robimy plik kowal.lua a w nim
Kod:
--------------------------------------------------------------------------------------------
------------------------------------ Kowal ------------------------------------
--------------------------- Script by Sharky --------------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
addon_need_premium = 'Sorry, you need a premium account to get addons.'
addon_have_already = 'Sorry, you already have this addon.'
addon_have_not_items = 'Sorry, you don\'t have these items.'
addon_give = 'Here you are.'
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
if msgcontains(msg, 'kowal') then
selfSay('Wyrabiam golden helmet, Dragon scale legs i warlord sword.')
------------------------------------------------ golden helmet ------------------------------------------------
elseif msgcontains(msg, 'golden helmet') then
if isPremium(cid) then
if getPlayerItemCount(cid,6500) >= 100 and getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,6546) >= 1 then
selfSay('Czy masz 100 demonic essence, 100 piece of royal steel i dracola\'s eye?')
talk_state = 1
else
selfSay('Potrzebuje 100 demonic essence, 100 piece of royal steel i dracola\'s eye.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,6500) >= 100 and getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,6546) >= 1 then
if doPlayerTakeItem(cid,6500,100) == 0 and doPlayerTakeItem(cid,5887,100) == 0 and doPlayerTakeItem(cid,6546,1) == 0 then
doPlayerAddItem(cid,2471, 1)
end
else
selfSay(addon_need_premium)
end
------------------------------------------------ dragon scale legs ------------------------------------------------
elseif msgcontains(msg, 'dragon scale legs') then
if isPremium(cid) then
if getPlayerItemCount(cid,5920) >= 100 and getPlayerItemCount(cid,5877) >= 100 then
selfSay('Czy masz 100 smoczych skor i 100 zielonych smoczych lusek??')
talk_state = 2
else
selfSay('Potrzebuje 100 smoczych skor i 100 zielonych smoczych lusek.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,5920) >= 100 and getPlayerItemCount(cid,5877) >= 100 then
if doPlayerTakeItem(cid,5920,100) == 0 and doPlayerTakeItem(cid,5877,100) == 0 then
doPlayerAddItem(cid,2469, 1)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ Warlord sword ------------------------------------------------
elseif msgcontains(msg, 'warlord sword') then
if isPremium(cid) then
if getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,7390) >= 1 then
selfSay('Czy masz 100 piece of royal steel i justice seeker?')
talk_state = 3
else
selfSay('Potrzebuje 100 piece of royal steel i justice seeker.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,5887) >= 100 and getPlayerItemCount(cid,7390) >= 1 then
if doPlayerTakeItem(cid,5887,50) == 0 and doPlayerTakeItem(cid,7390,1) == 0 then
doPlayerAddItem(cid,2408, 1)
end
else
selfSay(addon_have_not_items)
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <=3) then
selfSay('Ok than.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
potem robimy plik kowal.xml i wklejamy
Cytat:
<?xml version="1.0"?>
<npc name="Kowal" script="data/npc/scripts/kowal.lua" access="5" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="131" head="114" body="114" legs="0" feet="114" addons="3"/>
</npc>
teraz opiszê jak on dzia³a otó¿ wyrabia nam 3 przedmioty
Dragon scale legs
warlord sword
golden helmet
teraz co trzeba miec aby dostac przedmiot
dragon scale legs-100 green dragon scale i 100 green dragon leather
golden helmet-100 piece of royal steel, 100 demonic essence i dragonla's eye
warlord sword- justice seeker i 100 piece of royal steel
dziala na aries z mapka evo
prosze o komentarze
edit
nie zauwazylem zly dzial prosze o przeniesienie do xml
przepraszam
ivelios
trudno zeby nick nie byl taki sam ;p
lecz przegladajac ten temat zobaczylem ze sie jednak rozni , moj jest to raczej ots for fun a nie rpg(chociaz kto wie) bazuje on na klasycznej wymianie przedmiotow. tamten z tego co przegladalem ma za zadanie sprawic aby gracz sam wykul przedmiot, wiec chyba jest roznica.
moze chociaz jeden ots stanie sie przez to urozmaicony
Pozdrawiam
Sharky
Ostatnio edytowany przez dzido (2008-09-28 13:42:28)
Offline
Ty i ten skrypt.. nawet jubilera nie umiesz zrobic :]
Skrypt ciekawy, tylko szkoda, ¿e kowal ma tak ma³o umiejêtno¶ci.
Offline
mnie te¿ to zdziwi³o bo jako¶ mu dawa³em skrypta na npc co assassinki po 10 cc wiêc wbi³em na tibia.net.pl i wpisa³em kowal i by³ ale te¿ wiedzia³em ¿e to nie jego bo go jako¶ widzia³êm.
Offline
Zbanowany
Nom tez go widzia³em na tnp i nawet nie napisa³e¶ ¿e to nie twój ale te¿ nie napisa³e¶ chocia¿ ¿e twój ;]
Offline
Skrypt fajny ,ale nie twój ,za k³amstwo da³bym ci munus , lae sie zlituje
Offline
Dobrze link usune i wezme w quote
Offline
Zbanowany
Zwykly skrypt z 7.6 z Loozik ots itp. na jakies wyspie co sie nazywa na G (jest taka mapa z inferna itp.)zabijasz jakies super fajnew kosmos stwory dochodzisz do kowala i on za 1cc chyba albo zalezy od wartosci itema daje ci sklad a obok jest dzwignia kladziesz item i masz nowe
Offline
Skrypcik fajny przyda sie w OTS'ach rpg (zmienic z np. dsl na np. crown legs) tylko ze nie moj
Offline
Offline
Zbanowany
Offline