Actions Helix Token jak na D.B World.

Status
Zamknięty.

Breaak

Advanced User
Zarejestrowany
Dołączył
Czerwiec 1, 2011
Posty
150
Liczba reakcji
11
---Skrypt usuni?ty z powodu nag?ego wy?miania mnie o ten skrypt.
 
Odp: Helix Token jak na D.B World.

Takie bardziej wielozadaniowe... : )

[12000] to action id d?wigni, czy czego? tam. Reszt? sami rozkminiajcie. Nie wiem czy dzia?a.

Kod:
local config = 
{
	[12000] = 
	{
		items = 
		{
			[2390] = {position = {x=1000, y=1000, z=7, stackpos=2}, count = 1},
			[2160] = {position = {x=1001, y=1000, z=7, stackpos=1}, count = 100}
		},
		teleportPlace = {x=1100, y=1100, z=7},
		effect = CONST_ME_MAGIC_BLUE,
		message = {MESSAGE_INFO_DESCR, 'Zostales teleportowany do coffe shopu.'},
		removeItems = true
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local teleport = config[item.actionid]
	if(not teleport) then
		return 0
	end
	local items = {}
	for k, v in pairs(teleport.items) do
		local thing = getThingfromPos(v.position)
		if(thing.itemid ~= k or thing.type < v.count) then
			doPlayerSendCancel(cid, 'Musisz polozyc w odpowiednie miejsce ' .. (v.count > 1 and v.count or '') .. ' "' .. getItemIdByName(k) .. '".')
			return 1
		end
		table.insert(items, {uid = thing.uid, count = v.count})
	end
	doSendMagicEffect(getCreaturePosition(cid), teleport.effect)
	doTeleportThing(cid, teleport.teleportPlace)
	doSendMagicEffect(teleport.teleportPlace, teleport.effect)
	if(teleport.removeItems) then
		for _, v in pairs(items) do
			doSendMagicEffect(getThingPos(v.uid), teleport.effect)
			doRemoveItem(v.uid, v.count)
		end
	end
	doPlayerSendTextMessage(cid, teleport.message[1], teleport.message[2])
	return 1
end
 
Ostatnia edycja:
Odp: Helix Token jak na D.B World.

INFO: Starting OTScript Debug.lua
INFO: Stopping OTScript Debug.lua


Debugu nie ma czyli powinno dzia?a?.
 
Odp: Helix Token jak na D.B World.

A przerobi?by kto? skrypt pana 1 ?eby items wraca? do backpacka?: >
 
Odp: Helix Token jak na D.B World.

For Mr. Up, after:
Kod:
doTeleportThing(cid, teleport.teleportPlace)
just add
Kod:
doPlayerAddItem(cid,v.uid, v.count)
 
Odp: Helix Token jak na D.B World.

<up>
Delete
Kod:
doRemoveItem(getitem.uid)
and add
Kod:
doPlayerAddItem(cid,v.uid, v.count)
where
cid - u?ytkownik w tym stylu to player
uid - id
count - liczy? czyli ile razy ma doda? item.
< Polak to nie peda? wiec nie u?ywam angielskiego >
Kod:
doTeleportThing(cid, teleport.teleportPlace)
Zamie? na .:
Kod:
doPlayerAddItem(cid,1.uid, 1.count)
Powiedz czy dzia?a czy nie bo nie sprawdza?em obawiam si? ?e nie ;/.
 
Ostatnia edycja:
Odp: Helix Token jak na D.B World.

Zrobi?em tak jak kazales i dupa nie dzia?a ;/
 
Status
Zamknięty.
Back
Do góry