What's new

Problem z dwoma questami.

Status
Not open for further replies.

FerN

Senior User
Joined
Apr 10, 2009
Messages
597
Reaction score
27
Mam problem z dwoma questami, chodzi tu o Anihilator (skrzynie i wej?cie do roomu) oraz Pits of Inferno quest, a dok?adnie ko?cowe skrzynie... Nie wiem czemu, ale nie dzia?aj? [...]
Oto skrypty:
Anihilator Quest (teleport do roomu):
PHP:
local config = {
    storage = 6217412,
    tylkoRaz = "nie",
    lvl = 100
    tylkoRazNaDzien = "nie",
    summonowacPotwory = "tak"
    startUid = 8000
    items = {2494,2400,2431,2112} 
    players = {  
        {x=349, y=532, z=14, stackpos=253},
        {x=350, y=532, z=14, stackpos=253},
        {x=351, y=532, z=14, stackpos=253},
        {x=352, y=532, z=14, stackpos=253}},
    npos = {
        {x=391, y=536, z=14},
        {x=392, y=536, z=14},
        {x=393, y=536, z=14},
        {x=394, y=536, z=14}},
    monsterPos = {
        [1] = {"Demon",{x=391,y=534,z=14,stackpos=253}},
        [2] = {"Demon",{x=393,y=534,z=14,stackpos=253}},
        [3] = {"Demon",{x=392,y=538,z=14,stackpos=253}},
        [4] = {"Demon",{x=394,y=538,z=14,stackpos=253}},
        [5] = {"Demon",{x=395,y=536,z=14,stackpos=253}},
        [6] = {"Demon",{x=396,y=536,z=14,stackpos=253}}
        }
}
function onUse(cid,item,frompos,item2,topos)
local found = 0
    if item.itemid == 1945 then
        for i = 1, #config.players do
            local player = getThingfromPos(config.players[i])
            if isPlayer(player.uid) ~= TRUE then
                return doPlayerSendCancel(cid,"You need four players for this quest.") + 1
            end
            if getPlayerLevel(player.uid) >= lvl then
                return doPlayerSendCancel(cid,"Somebody in your team hasn't required level!")
            end
            if config.tylkoRaz == "tak" then
                if getPlayerStorageValue(player.uid,config.storage) == 1 then
                    return doPlayerSendCancel(cid,"Somebody in your team already has a quest.") + 1
                end
            found = found + 1
            end
        end
        if found == 4 then
            for i = 1, 4 do
                doTeleportThing(getThingfromPos(config.players[i]).uid,config.npos[i])
                doSendMagicEffect(config.npos[i],12)
                doSendAnimatedText(config.npos[i],"Fight!",192)
            end
            if config.tylkoRazDziennie == "tak" then
                doTransformItem(item.uid,item.itemid+1)
            end
            if config.summonowacPotwory ~= "tak" then
                return TRUE
            end
            for y = 1, 6 do
                local monster = getThingfromPos(config.monsterPos[y][2])
                if monster.uid > 0 then 
                    doCreatureAddHealth(monster.uid,-9999999999)
                end
                doSummonCreature(config.monsterPos[y][1],config.monsterPos[y][2])
                doSendMagicEffect(config.monsterPos[y][2],12)
            end
        end
        return TRUE
    end
    if getPlayerStorageValue(cid,config.storage) == 1 then
        doPlayerSendTextMessage(cid,22,"This's empty.")
        return TRUE
    end
    for i = 1, #config.items do 
        if item.uid == config.startUid+i then
            setPlayerStorageValue(cid,config.storage,1)
            doPlayerAddItem(cid,config.items[i],1)
            return TRUE
        end
    end
    return TRUE
end

Anihilator Quest: (skrzynie)
PHP:
-- annihilator chests
function onUse(cid, item, fromPosition, itemEx, toPosition)

   	if item.uid == 5006 then
   		queststatus = getPlayerStorageValue(cid,5010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon Armor.")
   			doPlayerAddItem(cid,2494,1)
   			setPlayerStorageValue(cid,5010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 5007 then
   		queststatus = getPlayerStorageValue(cid,5010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Sword of Valor.")
   			doPlayerAddItem(cid,2400,1)
   			setPlayerStorageValue(cid,5010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 5008 then
   		queststatus = getPlayerStorageValue(cid,5010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Stonecutter's Axe.")
   			doPlayerAddItem(cid,2431,1)
   			setPlayerStorageValue(cid,5010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 5009 then
   		queststatus = getPlayerStorageValue(cid,5010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Thunder Hammer.")
   			doPlayerAddItem(cid,2421,1)
   			setPlayerStorageValue(cid,5010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

Oraz Pits of Inferno Quest: (skrzynie)
PHP:
if item.uid == 6000 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a arcane staff.")
doPlayerAddItem(cid,2453,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 6001 then
queststatus = getPlayerStorageValue(cid,101)
if queststatus -= 1 then
doPlayerSendTextMessage(cid,22,"You have found a avenger.")
doPlayerAddItem(cid,6528,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 6002 then
queststatus = getPlayerStorageValue(cid,102)
if queststatus -= 1 then
doPlayerSendTextMessage(cid,22,"You have found a arbalest.")
doPlayerAddItem(cid,5803,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
return 1
end

Prosz? o jak najszybsz? pomoc, z g?ry dzi?ki.
 

DavisX

Advanced User
Joined
Jul 7, 2008
Messages
399
Reaction score
21
Odp: Problem z dwoma questami.

Wpisa?e? w skrzyniach to Uid ID co w skrypcie?

Data>Actions>Scripts>PoI
-- poichest chests

function onUse(cid, item, frompos, item2, topos)

if item.uid == 9500 then
queststatus = getPlayerStorageValue(cid,9200)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a Arcane Staff.")
doPlayerAddItem(cid,2453,1)
setPlayerStorageValue(cid,9200,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
elseif item.uid == 9501 then
queststatus = getPlayerStorageValue(cid,9200)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a Avanger.")
doPlayerAddItem(cid,6528,1)
setPlayerStorageValue(cid,9200,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
elseif item.uid == 9502 then
queststatus = getPlayerStorageValue(cid,9200)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a Arbalest.")
doPlayerAddItem(cid,5803,1)
setPlayerStorageValue(cid,9200,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
else
return 0
end

return 1
end

Data>Actions>Actions.Xml
<action uniqueid="9500" script="poi/poichest.lua" />
<action uniqueid="9501" script="poi/poichest.lua" />
<action uniqueid="9502" script="poi/poichest.lua" />
 

Sassin

Forum friend
Joined
Jun 13, 2009
Messages
1,281
Reaction score
107
Odp: Problem z dwoma questami.

Masz tu m?j anni :)

-- Annihilator script by Sassin
-- Room check and monster removal by Tworn

--Variables used:

-- player?pos = The position of the players before teleport.
-- player? = Get the thing from playerpos.
--player?level = Get the players levels.
--questslevel = The level you have to be to do this quest.
--questtatus? = Get the quest status of the players.
--demon?pos = The position of the demons.
--nplayer?pos = The position where the players should be teleported too.
--trash= position to send the demons to when clearing, 1 sqm in middle of nowhere is enough
-- starting = Upper left point of the annihilator room area.
-- ending = Bottom right point of the annihilator room area.

--UniqueIDs used:

--4646 = The switch.
--4647 = Demon Armor chest.
--4648 = Magic Sword chest.
--4649 = Stonecutter Axe chest.
--4650 = Present chest.


function onUse(cid, item, frompos, item2, topos)
if item.uid == 4646 then
if item.itemid == 1946 then

player1pos = {x=554, y=737, z=10, stackpos=253}
player1 = getThingfromPos(player1pos)

player2pos = {x=553, y=737, z=10, stackpos=253}
player2 = getThingfromPos(player2pos)

player3pos = {x=552, y=737, z=10, stackpos=253}
player3 = getThingfromPos(player3pos)

player4pos = {x=551, y=737, z=10, stackpos=253}
player4 = getThingfromPos(player4pos)


if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then

player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
player3level = getPlayerLevel(player3.uid)
player4level = getPlayerLevel(player4.uid)

questlevel = 100

if player1level >= questlevel and player2level >= questlevel and player3level >= questlevel and player4level >= questlevel then

queststatus1 = getPlayerStorageValue(player1.uid,987)
queststatus2 = getPlayerStorageValue(player2.uid,987)
queststatus3 = getPlayerStorageValue(player3.uid,987)
queststatus4 = getPlayerStorageValue(player4.uid,987)

if queststatus1 == -1 and queststatus2 == -1 and queststatus3 == -1 and queststatus4 == -1 then
--if 1==1 then

demon1pos = {x=551, y=726, z=10}
demon2pos = {x=553, y=726, z=10}
demon3pos = {x=552, y=730, z=10}
demon4pos = {x=554, y=730, z=10}
demon5pos = {x=555, y=728, z=10}
demon6pos = {x=556, y=728, z=10}

doSummonCreature("Demon", demon1pos)
doSummonCreature("Demon", demon2pos)
doSummonCreature("Demon", demon3pos)
doSummonCreature("Demon", demon4pos)
doSummonCreature("Demon", demon5pos)
doSummonCreature("Demon", demon6pos)

nplayer1pos = {x=554, y=728, z=10}
nplayer2pos = {x=553, y=728, z=10}
nplayer3pos = {x=552, y=728, z=10}
nplayer4pos = {x=551, y=728, z=10}

doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doSendMagicEffect(player3pos,2)
doSendMagicEffect(player4pos,2)

doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doTeleportThing(player3.uid,nplayer3pos)
doTeleportThing(player4.uid,nplayer4pos)

doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)
doSendMagicEffect(nplayer3pos,10)
doSendMagicEffect(nplayer4pos,10)

doTransformItem(item.uid,1945)

else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
end
if item.itemid == 1945 then
-- Here is the code start:
starting={x=454, y=578, z=9, stackpos=253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x=472, y=584, z=9, stackpos=253}
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
if creature.itemid > 0 then
if getPlayerAccess(creature.uid) == 0 then
players=players+1
end
if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
totalmonsters=totalmonsters+1
monster[totalmonsters]=creature.uid
end
end
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
if players==0 then
trash= {x=471, y=563, z=9}
current=0
repeat
current=current+1
doTeleportThing(monster[current],trash)
until current>=totalmonsters
doTransformItem(item.uid,1946)
end
-- Here is the end of it

end
end
if item.uid == 4647 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
doPlayerAddItem(cid,2494,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 4648 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
doPlayerAddItem(cid,2400,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 4649 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
doPlayerAddItem(cid,2431,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 4650 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a Annihilation Bear.")
doPlayerAddItem(cid,2326,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
return 1
end

Wszystko w 1 skrzynki summonowanie dem?w i samo wej?cie:)

<action uniqueid="4646" script="quests/annihilator.lua" /> - dzwignia
<action uniqueid="4647" script="quests/annihilator.lua" /> - dem arm
<action uniqueid="4648" script="quests/annihilator.lua" /> - magic sword
<action uniqueid="4649" script="quests/annihilator.lua" /> - sca
<action uniqueid="4650" script="quests/annihilator.lua" /> - annilator bear

Mam nadzieje ?e Ci pomog?em

Pozdrawiam
Sassin
 

FerN

Senior User
Joined
Apr 10, 2009
Messages
597
Reaction score
27
Odp: Problem z dwoma questami.

Masz tu m?j anni :)
Wszystko w 1 skrzynki summonowanie dem?w i samo wej?cie:)
Mam nadzieje ?e Ci pomog?em
Pozdrawiam
Sassin


Chesty dzia?aj?, aczkolwiek teleport do roomu nie ;\
Wyskakuje b??d:
Code:
[13/08/2009 08:29:46] luaGetThingFromPos(). Tile not found

[13/08/2009 08:29:46] Lua Script Error: [Action Interface] 
[13/08/2009 08:29:46] data/actions/scripts/quests/annihilator.lua:onUse
 

Dragonas

Advanced User
Joined
Jul 11, 2009
Messages
321
Reaction score
18
Age
31
Odp: Problem z dwoma questami.

Musisz w tym skrypcie zmieni? pozycje x/y na swoje.
 
Status
Not open for further replies.
Top