Dziki Johnson
Kafar
- Joined
- Jul 7, 2010
- Messages
- 2,061
- Reaction score
- 193
- Age
- 27
Odp: Pytania z OT by lucas20
Stawiasz corpse i w unique id wpisujesz id klucza
Stawiasz corpse i w unique id wpisujesz id klucza
<action actionid="6790" event="script" value="key.lua"/>
function onUse(cid,item,itemEx,fromPosition,toPosition)
local key = doCreateItemEx(2086, 1)
if item.actionid == 6790 and getPlayerStorageValue(cid,53001) == -1 then
doPlayerAddItemEx(cid, key, 1)
doSetItemActionId(key, 5430)
setPlayerStorageValue(cid,53001,1)
doPlayerSendTextMessage(cid,22,'You have found purple key.')
else
doPlayerSendTextMessage(cid,22,'It is empty.')
end
return true
end
5430doSetItemActionId(key, 5430)
[22/06/2010 14:34:48] [Error - Action Interface]
[22/06/2010 14:34:48] data/actions/scripts/key.luanUse
[22/06/2010 14:34:48] Description:
[22/06/2010 14:34:48] data/actions/scripts/key.lua:5: attempt to call global 'doSetItemActionId' (a nil value)
[22/06/2010 14:34:48] stack traceback:
[22/06/2010 14:34:48] data/actions/scripts/key.lua:5: in function <data/actions/scripts/key.lua:1>
odwoluje sie, probuje powiedziec globalowi te podfunkcjeo SetItemActionId', ktora ma wartosc zerowa chyba 0.. nie mam poj?cia co jest nie takdoSetItemActionId(key, 5430)
function onUse(cid, item, frompos, item2, topos)
if item.uid == [COLOR="Lime"]2431[/COLOR] then
queststatus = getPlayerStorageValue(cid,2431)
if queststatus == -1 then
doPlayerSendTextMessage(cid,25,"Otrzymales stonecutter axe.") <--Jaka nagroda
doPlayerAddItem(cid,[COLOR="Red"]2431[/COLOR],[COLOR="Blue"]1[/COLOR])
setPlayerStorageValue(cid,[COLOR="Yellow"]2431[/COLOR],1)
else
doPlayerSendTextMessage(cid,25,"Skrzynka jest pusta.")
end
end
return true
end
<action uniqueid="[COLOR="Lime"]2431[/COLOR]" event="script" value="quests/avenger.lua" />
nazwa?em sobie chest.lua.. i teraz:Utworz plik w data/actions/scripts/nazwa pliku.lua
23:09 You see a demonbone (Atk:48, Def:38 -2).
It can only be wielded properly by players of level 80 or higher.
It weighs 180.00 oz.
function onUse(cid, item, frompos, itemEx, topos)
local config = {
[[COLOR="Lime"]2160[/COLOR]] , storage = [COLOR="SandyBrown"]2160[/COLOR], item = {[COLOR="Magenta"]2160[/COLOR]}, ilosc = {[COLOR="DeepSkyBlue"]100[/COLOR]}, unique_itemow = {[COLOR="Gray"]1500[/COLOR]}}
}
local skrzynka = config[item.uid]
if getPlayerStorageValue(cid, skrzynka.storage) == -1 then
for i = 1, #skrzynka.item do
local itemy = doPlayerAddItem(cid, skrzynka.item[i], skrzynka.ilosc[i], true)
doItemSetAttribute(itemy, "uid", skrzynka.unique_itemow[i])
doPlayerSendTextMessage(cid, 22, "Znalazles "..skrzynka.ilosc[i].." "..getItemNameById(skrzynka.item[i])..".")
setPlayerStorageValue(cid, skrzynka.storage, 1)
end
else
doPlayerSendTextMessage(cid, 22, "Skrzynia jest pust.")
end
end
return true
end
i tutaj zmieniasz<movevent type="Equip" itemid="8865" slot="armor" level="65" event="function" value="onEquipItem">
<vocation id="1"/>
<vocation id="5" showInDescription="0"/>
</movevent>
[B]<vocation name="Elder Druid"/>[/B]
<movevent type="DeEquip" itemid="8904" slot="shield" event="function" value="onDeEquipItem"/>
<movevent type="Equip" itemid="8918" slot="shield" level="80" event="function" value="onEquipItem">
[B]<vocation name="Elder Druid"/>[/B]
</movevent>
<movevent type="DeEquip" itemid="8918" slot="shield" event="function" value="onDeEquipItem"/>
</movements>