What's new

Soft boots

rafcio_100

Advanced User
Joined
Dec 30, 2008
Messages
218
Reaction score
8
Mam taki problem ?e nie dzia?a mi ?adowanie soft?w na ots'ie. Oto ich ustawienie
<item id="2640" name="soft boots">
<attribute key="weight" value="800"></attribute>
<attribute key="slotType" value="feet"></attribute>
<attribute key="decayTo" value="6530"></attribute>
<attribute key="transformDeEquipTo" value="6132"></attribute>
<attribute key="duration" value="14400"></attribute>
<attribute key="healthGain" value="1000"></attribute>
<attribute key="HealthTicks" value="1000"></attribute>
<attribute key="manaGain" value="500"></attribute>
<attribute key="manaTicks" value="1000"></attribute>
<attribute key="showduration" value="1"></attribute>
</item>
<item id="2641" name="traper boots">
<attribute key="weight" value="900"/>
<attribute key="armor" value="3"/>
<attribute key="slotType" value="feet"/>
</item>

Prosz? o pomoc.
 

Roberto_93

Active User
Joined
Oct 13, 2008
Messages
85
Reaction score
6
Odp: Soft boots

Mozliwe ze blad amsz z npc a nie z softami sprobujzrobic nowego npc od wymiany starych softow na nowe
Tu masz skrypt do npc ktoryzmienia stare softy na nowe
data/npc/scripts/soft.lua
local focuses = {}
local function isFocused(cid)
for i, v in pairs(focuses) do
if(v == cid) then
return true
end
end
return false
end

local function addFocus(cid)
if(not isFocused(cid)) then
table.insert(focuses, cid)
end
end
local function removeFocus(cid)
for i, v in pairs(focuses) do
if(v == cid) then
table.remove(focuses, i)
break
end
end
end
local function lookAtFocus()
for i, v in pairs(focuses) do
if(isPlayer(v) == TRUE) then
doNpcSetCreatureFocus(v)
return
end
end
doNpcSetCreatureFocus(0)
end

function onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
if(isFocused(cid)) then
selfSay("Hmph!")
removeFocus(cid)
if(isPlayer(cid) == TRUE) then --Be sure he's online
closeShopWindow(cid)
end
end
end


function onCreatureSay(cid, type, msg)
if((msg == "hi") and not (isFocused(cid))) then
selfSay("Welcome, ".. getCreatureName(cid) .."Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?", cid, TRUE)
selfSay("Do you want {specialised}?", cid)
addFocus(cid)
elseif((isFocused(cid)) and (msg == "boot" or msg == "specialised")) then
selfSay('I need 10k and worn soft boots , to give you the repared soft boots. Say {worn soft boots}.', cid)

------------------------------------------------
------------------------------------------------
elseif((isFocused(cid)) and (msg == "soft boots" or msg == "soft boot" or msg == "worn soft boots" or msg == "worn soft boot")) then
if isPremium(cid) then
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 or getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
selfSay('Did you bring me 10k and worn soft boots?', cid)
talk_state = 1
else
selfSay('I need 10k and worn soft boots , to give you the repared soft boots. Come back when you have them.', cid)
talk_state = 0
end
else
selfSay('You need premmy account, to repare soft boots.')
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif((isFocused(cid)) and (msg == "yeah" or msg == "yes")) and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 or getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2152,100) == 0 or doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2160,1) == 0 then
selfSay('Here you are.')
doPlayerAddItem(cid,2640,1)
end
else
selfSay('Sorry, you don\'t have these items.')
end
elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
selfSay("Goodbye!", cid, TRUE)
removeFocus(cid)
end


function onThink()
for i, focus in pairs(focuses) do
if(isCreature(focus) == FALSE) then
removeFocus(focus)
else
local distance = getDistanceTo(focus) or -1
if((distance > 4) or (distance == -1)) then
selfSay("Hmph!")
closeShopWindow(focus)
removeFocus(focus)
end
end
end
lookAtFocus()
end
end

druga czesc:
data/npc/softer.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Softer" script="data/npc/scripts/soft.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="325" head="0" body="79" legs="94" feet="0" addons="1"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I Repair u worn firewalkerboots !."/>
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/>
</parameters>
</npc>
 

rafcio_100

Advanced User
Joined
Dec 30, 2008
Messages
218
Reaction score
8
Odp: Soft boots

A b??d mo?e by? spowodowany brakiem NPC od soft?w??
 

Dr4goN510

Active User
Joined
Jan 10, 2009
Messages
68
Reaction score
5
Odp: Soft boots

Rafcio 100 czy ty w kulki lecisz? Jak mo?e ci nie dzia?a? ?adowanie soft?w skoro jak 1 post up piszesz, ze nie masz npc!! Wyt?umacz mi to prosz? bo ja cie nie rozumiem.
 

rafcio_100

Advanced User
Joined
Dec 30, 2008
Messages
218
Reaction score
8
Odp: Soft boots

Zrobi?em nowego Softera ale niestety gdy chcia?em go zasummonowa?, by? debug.
 

Misieqp

Advanced User
Joined
Apr 28, 2009
Messages
269
Reaction score
17
Odp: Soft boots

wstaw go na mapce<map edytor> a nie summonujac w grze.
 

Misieqp

Advanced User
Joined
Apr 28, 2009
Messages
269
Reaction score
17
Odp: Soft boots

Hm... a w jaki spos?b??


Otworz mapke, map edytorem.(trzeba pobrac xd)

Nastepnie obok w tabeli masz 'NPC' zrob respawn, i wtsaw npc. Daj mu name taki jak masz w pliku.

Zobacz czy map edytor czyta wszystkie npc, jesli przy uruchomieniu wyskaca bledy, to znaczy ze ich nie czyta, po zapisaniu mapki ich nie bedzie. Sma je wsta na mapce badz dopisz w creatures!
 

rafcio_100

Advanced User
Joined
Dec 30, 2008
Messages
218
Reaction score
8
Odp: Soft boots

Hm... tak wszystko pi?knie tylko ?e nadal debug ;/
 

adalox144

Active User
Joined
Mar 20, 2009
Messages
87
Reaction score
5
Odp: Soft boots

Wszystko pieknie ladnie ale wczesniej musi dodac tego npc do map editora:)
 

rafcio_100

Advanced User
Joined
Dec 30, 2008
Messages
218
Reaction score
8
Tak, i doda?o go, ale c??, jak nadal debug.
przepraszam za post @down
Przepraszam za napisanie posta pod postem, ale zauwa?y?em pewn? rzecz. Przytocze tu skrypty trzech npc, prosz? je por?wna? z tym od soft?w (dziwne r??nice zaznacz? na czerwono).
<?xml version="1.0"?>
<npc name="Frodo" script="data/npc/scripts/seller.lua" access="1" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="134" head="114" body="113" legs="113" feet="113"/>
</npc>
<?xml version="1.0"?>
<npc name="Maya" script="data/npc/scripts/bows.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="142" head="79" body="118" legs="115" feet="114"/>
</npc>
<?xml version="1.0"?>
<npc name="Gamer" script="data/npc/scripts/jokenpo.lua" autowalk="0" floorchange="0">
<health now="100" max="100"/>
<look type="273" head="20" body="39" legs="45" feet="7"/>
</npc>
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Softer" script="data/npc/scripts/soft.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="325" head="0" body="79" legs="94" feet="0" addons="1"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I Repair u worn firewalkerboots !."/>
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/>
</parameters>

</npc>
//Sklejone.
 
Last edited by a moderator:
Top