• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

doSetItemActionId problem

Keram

Member
Joined
Jan 8, 2012
Messages
491
Reaction score
12
Location
DUBLIN
Hejka,

już czekam na pomoc w premium board od kilku dni ale tam się nikt użytkownikami nie zajmuję (a jak już to raz na miesiąc)... Więc się zdenerwowałem i przyszedłem tutaj...

Mój problem polega na tym, że jak kupuję od NPC klucz to on mi go daje jednak nie zmienia actionid na takie jakie jest w skrypcie...
Zrobiłem też kiedyś questa, że jak się naciska na drzewo to się dostaje klucz o actionid xxxx... Jednak po kliknięciu dostawałem klucz z actionid 0 więc myślałem, że coś źle robię więc się poddałem.

Jednak gdy błąd się pojawił w NPC, którego nie ja nawet robiłem to już napisałem na forum.

Oto skrypt do npc:
Lua:
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




function key(cid, message, keywords, parameters, node)
   if(not npcHandler:isFocused(cid)) then
        return false
    end
    
    local player_gold     = getPlayerItemCount(cid,2148)
    local player_plat     = getPlayerItemCount(cid,2152)*100
    local player_crys     = getPlayerItemCount(cid,2160)*10000
    local player_money     = player_gold + player_plat + player_crys
	
         if player_money >= 1000 then
        if doPlayerRemoveMoney(cid,1000) then
            npcHandler:say('Here it is.', cid)
            local playerID = getPlayerGUID(cid)
                 local item = doPlayerAddItem(cid, 2089, 1)
             doSetItemActionId(item, 3142)
        end
        else
            npcHandler:say('You do not have enough gold.', cid)
    end
end	

node1 = keywordHandler:addKeyword({'key'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I would sell you a key for 1000 gold, ok?'})
node1:addChildKeyword({'yes'}, key, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then not.', reset = true})

node2 = keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I would sell you a key for 1000 gold, ok?'})
node2:addChildKeyword({'yes'}, key, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then not.', reset = true})

npcHandler:addModule(FocusModule:new())

Czy ktoś tutaj widzi w czym leży problem? jest niby doSetItemActionId a nie zmienia ;/

Przyznaję, że przez kilka dni zapomniałem czy wyskoczył mi wtedy jakiś błąd jednak jestem na 100% pewny, że jakby wyskakiwał to bym go zamieścił w temacie na premium board a jednak tam żadnego błędu nie zamieściłem więc widocznie mi nie wyskakiwał...

Z góry dziękuję.
 
Replace:
Lua:
doSetItemActionId(item, 3142)
With:
Lua:
doItemSetAttribute(item, "actionid", 3142)
 
@up
a no widzisz, zmieniłem tylko w tym co mi podałeś "actionid" na "aid" i działa... tak w ogóle to tej funkcji nie ma w moim FUNCTIONS_LUA w moim folderze DOC...

Jestem Ci dozgonnie wdzięczny :)

Dziękuję,

temat do zamknięcia :)
 
Back
Top