• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

[x.x][Skrypty] Zam?wienia

Status
Zamknięty.
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj- NPC
Tibia o protokole 7.92
Opis- Chodzi mi o klasycznego npc z rl 7.92 kt?ry uczy?by nas czar?w za kas?:)


Zobaczymy czy umiesz co? takiego zrobi? ... Na kiedy by?by skrypt gotowy??
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj - action
Tibia - 8.1
Opis: Chodzi mi o to, ?e kiedy u?yje m?otka na krze?le, to teleportuje mnie gdzie?. Chyba wiesz o co chodzi ;)
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Nie jestem pewien ale wydaje mi sie ze bedzie to tak:
Data/actions/scripts/mlotek.lua
Kod:
function onUse(cid, item, frompos, item2, topos)
local uid = [COLOR="Red"]xxxx[/COLOR]   -- Unique id krzesla
local newpos = {x=111, y=222, z=7}
if (item2.uid == uid) then
	doTeleportThing(cid,newpos)
end
end
Data/actions/actions.xml

Je?eli mlotek ma mie? okre?lone action id:


Kod:
<action actionid="action id mlotka" script="mlotek.lua" />

Je?eli mlotek ma mie? okre?lony unique id:

Kod:
<action uniqueid="unique id mlotka" script="mlotek.lua" />

Je?eli to ma by? ka?dy mlotek o okre?lonym id:


Kod:
<action itemid="id mlotka" script="mlotek.lua" />
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj - NPC
Tibia - 8.1
Opis - Sam robi clean, a przed cleanem save.
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj - NPC
Tibia - 8.1
Opis - Sam robi clean, a przed cleanem save.
Chyba tylko w C++ to si? da. A jak nie to powiedz, czy u ciebie s? funkcje typu:
Kod:
/clean
i
Kod:
/save
Jak s?, to prze?lij mi przyk?adowego npc z twojego otsa.
Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj- NPC
Tibia o protokole 7.92
Opis- Chodzi mi o klasycznego npc z rl 7.92 kt?ry uczy?by nas czar?w za kas?:)
Zobaczymy czy umiesz co? takiego zrobi? ... Na kiedy by?by skrypt gotowy??
Jest u ciebie na otsie funkcja doPlayerLearnSpell to prze?lij mi swojego przyk?adowego npc z otsa. Je?eli nie ma to ci tego nie zrobie ;/

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

1.
Rodzaj: Action
Tibia: 7.6
Opis: komenda !buyhouse

2.
Rodzaj: Action
Tibia: 7.6
Opis: Pvp od lvla

Mam nadzieje ze da sie to zrobic!
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

1.
Rodzaj: Action
Tibia: 7.6
Opis: komenda !buyhouse
2.
Rodzaj: Action
Tibia: 7.6
Opis: Pvp od lvla
Mam nadzieje ze da sie to zrobic!
Nie, nie da si?. To tylko w C++ da si?. Trzeba mie? source silnika i programiste C++, kt?rym nie jestem.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: Action, Item
Tibia: 8.22
Opis: Potrzebuje takiego ringa ?e jak za?o?? go to mi si? zwi?kszy fast attack!
Da si? takie co? zrobi?!?
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: Action, Item
Tibia: 8.22
Opis: Potrzebuje takiego ringa ?e jak za?o?? go to mi si? zwi?kszy fast attack!
Da si? takie co? zrobi?!?
Tylko C++. Niestety.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: Action, Item
Tibia: 8.22
Opis: A takiego ringa co jak za?o?? to mi zmienia profesje?!
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Jest u ciebie na otsie funkcja doPlayerLearnSpell to prze?lij mi swojego przyk?adowego npc z otsa. Je?eli nie ma to ci tego nie zrobie ;/

Pozdro,
Gelio

mam cos takiego:
Kod:
<?xml version="1.0"?>

<npc name="Frodo" script="data/npc/scripts/seller.lua" access="1" lookdir="2" autowalk="1">
	<mana now="800" max="800"/>
	<health now="200" max="200"/>
<look type="134" head="114" body="113" legs="113" feet="113"/>
</npc>

i w scripts
Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (10gp), manafluids (100gp), lifefluids (60gp), fishing rods (100gp), amulet of loss (10k), and torches (2gp). I buy vials (10gp).')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'shovel') then
			buy(cid,2554,getCount(msg),20)
		elseif msgcontains(msg, 'backpack') then
			buy(cid,1988,getCount(msg),10)
		elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') then
			buyFluidContainer(cid,2006,getCount(msg),100,7)
		elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') then
			buyFluidContainer(cid,2006,getCount(msg),60,10)
		elseif msgcontains(msg, 'fishing rod') then
			buy(cid,2580,getCount(msg),100)
		elseif msgcontains(msg, 'torch') then
			buy(cid,2050,getCount(msg),2)
		elseif msgcontains(msg, 'rope') then
			buy(cid,2120,getCount(msg),50)
		elseif msgcontains(msg, 'aol') then
			buy(cid,2173,getCount(msg),10000)	
		elseif msgcontains(msg, 'vial') or msgcontains(msg, 'flask') then
			sell(cid,2006,getCount(msg),10)

		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end

o co? takiego ci chodzi?o??
 
Prosze jeszcze o npc.
Tibia: 8.1
Opis: Gdy witamy sie z npc m?wi ''text''. My Odpowiadamy ''tak'', npc odpowiada ''text''. gdy odpowiadamy ''drewno'', npc zabieram nam item i mowi ''text'', my odpowiadamy ''tak'', npc daje nam item o action id ''xxxx'', i mowi ''text''.

Kod:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 node1 = keywordHandler:addKeyword({'promot', 'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Mozesz kupic u mnie promocje za 10000'})
	node1:addChildKeyword({'yes', 'tak'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 10000, level = 30, text = 'Gratulacje! Posiadasz promocje.'})
	node1:addChildKeyword({'no', 'nie'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Wroc kiedy bedziesz gotowy.', reset = true})
npcHandler:addModule(FocusModule:new())
Sory zapomnia?em ^^

/Sklejam posty, nie r?bcie syfu w tym temacie
 
Ostatnio edytowane przez moderatora:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: Action, Item
Tibia: 8.22
Opis: A takiego ringa co jak za?o?? to mi zmienia profesje?!

Data/movements/scripts/ring.lua
Kod:
function onEquip(cid, item, slot)
local voc = 1 --- numer profesji na ktora sie zmieni po zalozeniu ring'a

 if(slot == 9) then
doPlayerSetVocation(cid,voc)
 end
return 1
end

Data/movements/movements.xml
Kod:
<movevent event="Equip" itemid="Item ID" slot="ring" script=”ring.lua” />
Kod:
<movevent event="Equip" actionid="AID" slot="ring" script=”ring.lua” />
Kod:
<movevent event="Equip" uniqueid="UID" slot="ring" script=”ring.lua” />

Wybierasz 1 z wyzej podanych albo po id/aid/uid ;]
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Prosze jeszcze o npc.
Tibia: 8.1
Opis: Gdy witamy sie z npc m?wi ''text''. My Odpowiadamy ''tak'', npc odpowiada ''text''. gdy odpowiadamy ''drewno'', npc zabieram nam item i mowi ''text'', my odpowiadamy ''tak'', npc daje nam item o action id ''xxxx'', i mowi ''text''.
No super, tylko jakby? nie zauwa?y? to: DAJ MI PRZYK?ADOWY SKRYPT TWOJEGO NPC!!

Pozdro,
Gelio

@edit
Za bardzo niestety nie orientuj? si? w tym nowym systemie NPC. Mo?e jako? mi si? uda, ale nie m?wie ?e na pewno.

@edit 2
Uda?o mi si? chyba. Do pliku *.lua npc wklej:
Kod:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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

talkState = 0
function creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return false
	end


		if msgcontains(msg, 'tak') then
		if (talkState == 0) then
			selfSay('Text, jezeli powiemy tak pierwszy raz.')
			talkState = 1
		elseif (talkState == 2) then
			selfSay('Text. Dawanie itemu o actionid z i id y')
			local item = doPlayerAddItem(cid,y,1)
			doSetItemActionId(item,z)
			talkState = 0
		end
		elseif msgcontains(msg, 'drewno') then
			if (talkState == 1) then
				if (getPlayerItemCount(cid,xxx) >= 1) then
				selfSay('Text, jezeli powiemy drewno. Zabieranie itemu o id xxx')
				doPlayerRemoveItem(cid,xxx,1)
				talkState = 2
			else
				selfSay('Co? Jakie drewno?')
			end
		end


	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Powinno dzia?a?.
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

mam cos takiego:
Kod:
<?xml version="1.0"?>
<npc name="Frodo" script="data/npc/scripts/seller.lua" access="1" lookdir="2" autowalk="1">
	<mana now="800" max="800"/>
	<health now="200" max="200"/>
<look type="134" head="114" body="113" legs="113" feet="113"/>
</npc>
i w scripts
Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)
  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (10gp), manafluids (100gp), lifefluids (60gp), fishing rods (100gp), amulet of loss (10k), and torches (2gp). I buy vials (10gp).')
  		focus = cid
  		talk_start = os.clock()
  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
	elseif focus == cid then
		talk_start = os.clock()
		if msgcontains(msg, 'shovel') then
			buy(cid,2554,getCount(msg),20)
		elseif msgcontains(msg, 'backpack') then
			buy(cid,1988,getCount(msg),10)
		elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') then
			buyFluidContainer(cid,2006,getCount(msg),100,7)
		elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') then
			buyFluidContainer(cid,2006,getCount(msg),60,10)
		elseif msgcontains(msg, 'fishing rod') then
			buy(cid,2580,getCount(msg),100)
		elseif msgcontains(msg, 'torch') then
			buy(cid,2050,getCount(msg),2)
		elseif msgcontains(msg, 'rope') then
			buy(cid,2120,getCount(msg),50)
		elseif msgcontains(msg, 'aol') then
			buy(cid,2173,getCount(msg),10000)	
		elseif msgcontains(msg, 'vial') or msgcontains(msg, 'flask') then
			sell(cid,2006,getCount(msg),10)
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
o co? takiego ci chodzi?o??
Zaraz ci to zrobie i dam edita.

Pozdro,
Gelio

@edit
Skrypt *.lua (*.xml chyba potrafisz zrobi? ;p) (na g?rze konfiguracja):
Kod:
local spell = {"exura", "utevo lux", "exori"}   -- Tutaj wpisujesz nazwy spelli (inkatacje czy cos takiego)
local cena = {180, 150, 800}    -- Cena dla poszczegolnego spella. Np. exura kosztuje 180 w tym przypadku


local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)
  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I all of spells. Just say \"spell name\".')
  		focus = cid
  		talk_start = os.clock()
  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
	elseif focus == cid then
		talk_start = os.clock()
	end
		for i=1, #spell do
			if msgcontains(msg, spell[i]) then
				if (pay(cid,cena[i]) then
					selfSay('I learnt you spell ".. spell[i] ..". It cost ".. cena[i] .. " gold.')
					doPlayerLearnSpell(cid,spell[i])
				else
					selfSay('".. spell[i] .." cost " .. cena[i] .. ". You don\'t have much gold.')
				end
			end
		end
		if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
Powinno dzia?a?.
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Ja co? sobie zamowie :)
Typ:action
Wersja:8.22 TFS
Opis:Chodzi mi oto ?e jak kamulcowi takiemu wysokiemu nadam unique id jakie?tam to wtedy acces 3 i wy?szy b?dzie m?g? go ruszy?,a inni nie.

@Down:To kiszka :(
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Ja co? sobie zamowie :)
Typ:action
Wersja:8.22 TFS
Opis:Chodzi mi oto ?e jak kamulcowi takiemu wysokiemu nadam unique id jakie?tam to wtedy acces 3 i wy?szy b?dzie m?g? go ruszy?,a inni nie.
Eee?? Co? Je?eli chodzi o to, ?e tylko jaki? access b?dzie m?g? go ruszy? to sie nie da.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: action
Tibia: 8.1
Opis: Przez drzwi o id5103 moze przejsc tylko knight, elite knight, paladin i royal paladin.
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Rodzaj: action
Tibia: 8.1
Opis: Przez drzwi o id5103 moze przejsc tylko knight, elite knight, paladin i royal paladin.
Here you are:
Kod:
function onUse(cid, item, frompos, item2, topos)
local position1 = {x=xxx, y=yyy, z=z}
local position2 = {x=xxx, y=yyy, z=z}

local profesje = {3,4,7,8}

for i=1, #profesje do
	if (getPlayerVocation(cid) == profesje[i]) then
		if (getPlayerPosition(cid).y == position1.y) then
			doTeleportThing(cid,position2)
		elseif (getPlayerPositon(cid).y == position2.y) then
			doTeleportThing(cid,position1)
		else
			doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
		end
	else
		doPlayerSendCancel(cid,"You need to be knight or paladin to pass the door.")
	end
end
end
Powinno dzia?a?.

Pozdro,
Gelio
 
Status
Zamknięty.
Do góry