What's new

-LUA & XML Quest skrzynkowy

Status
Not open for further replies.

skorapro

Advanced User
Joined
Jul 3, 2011
Messages
492
Reaction score
30
witam poszukuj? zwyk?ego skryptu na quest skrzynkowy pod 8.6 tfs 0.4
tzn klikam na skrzynk?, dostaj? np demon armor i napis: you have found a demon armor ;p
sprawdza?em skrypty z forum wi?kszo?? pod tfs 0.3.6 i nie dzia?a?y :/
 

Xevis

Senior User
Joined
May 28, 2008
Messages
836
Reaction score
54
Odp: Quest skrzynkowy

Chest.lua
PHP:
  local CONFIG =
{ --!< Nazwa Questa
        [xxxx] = {  -- Chest Unique ID
                chestLevel = xxx, -- Player Level
                chestStorage = xxx, -- Storage
                items = {{NAGRODA,1}}, -- {ITEM_ID,COUNT}
        },
        


function onUse(cid, item, fromPosition, itemEx, toPosition)
		if(exhaustion.check(cid, 43523)) then
			return true
		end
        local questStatus = getPlayerStorageValue(cid, CONFIG[item.uid].chestStorage)
        if (questStatus == -1) then
                if getPlayerLevel(cid) >= CONFIG[item.uid].chestLevel then
                        for i = 1, #CONFIG[item.uid].items do
                                doPlayerAddItem(cid, CONFIG[item.uid].items[i][1], CONFIG[item.uid].items[i][2])
                        end
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have found a treasure!.")
                        doSendAnimatedText(getCreaturePosition(cid), "[Succes!]", TEXTCOLOR_RED)
                        setPlayerStorageValue(cid, CONFIG[item.uid].chestStorage, 1)
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to be at least ".. CONFIG[item.uid].chestLevel.." level to open this chest.")
                end
        else
                doSendAnimatedText(fromPosition, "[Empty!]", TEXTCOLOR_WHITE)
        end
		exhaustion.set(cid, 43523, 2)
        return true
end



Actions:

PHP:
<action value="chest.lua" event="script" uniqueid="UNIQUE ID;....;unique...;"/>
 

skorapro

Advanced User
Joined
Jul 3, 2011
Messages
492
Reaction score
30
Odp: Quest skrzynkowy

chestStorage to nagroda?

---------- Tre?? dodana o 10:58 ----------

lipa nie dzia?a, dok?adnie tak jak jest kod skopiowa? i zmieni? tylko te xxx??
 

Xevis

Senior User
Joined
May 28, 2008
Messages
836
Reaction score
54
Odp: Quest skrzynkowy

Jak masz 2 takie same chest storage to mo?na wzi?? nagrode tylko z jednej skrzynki. Dla przyk?adu robi?? nagrody z Annihilatora, robisz 4x te same chest storage.
Dopisz jeszcze w 9-11 linijce ), bo zabrak?o zamkni?cia.
 
Status
Not open for further replies.
Top