Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Tut]Kowal, Tak Jak W Metin2 ;]


M@tiK

Rekomendowane odpowiedzi

Opublikowano

Witam was

Przedstawiam wam skrypt na kowala, dzieki ktoremu mozemy utworzc wybrane itemki.

Na poczatek robimy plik w data/npc/scripts pod nazwa kowal.lua

I wklejamy do niego:

-----------------------------------------------------------------------------------------
------------------------------------ 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())

nastepnie tworzymy plik xml pod nazwa kowal.xml i wklejamy do niego

<?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>

I od tej pory na mapie mamy kowala ;] potrafi on robic itemy takie jak

Dragon Scale Legs

Warlord Sword

Golden Helmet

A do zrobienia tych itemow potrzebujemy

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

Oczywiscie mozemy pozmieniac przedmioty do ulepszen w kodzie

Pamietajcie aby ustawic pozycje Kowala

I od tej pory mozemy robic itemki ;]

Pozdrawiam

skrypt nie moj!!

prosze modka o zdjecie 5% ;]

13032777318975834031.gif

  • 2 miesiące temu...
Opublikowano

Spoko TuTek możliwe, że skorzystam. Bo narazie coś mi nie działa metin2 więc zagram w tibie na swoim OTS z kolegami. :) oczywiście leci +

48402464016452232540.png

sygnaturarv.png

Podnieca Cię jak robisz komuś na złość?

Jeśli tak to oznacza że jesteś NEO!

Tak tak to do Ciebie dlatego że dałeś mi + zamiast - !

 

I'm back! Are you fucking kidding me ?

Daj - ;D

Opublikowano

No no , zaje*isty ten kowal. Raczej nie skorzystam ale i tak masz +. Przyda się np. przy zwiększeniu arma i ataku tych itemów, i będzie sobie można robić. :P

+

beznazwywj.png

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...