What's new

Questy podobne do anhi.

Status
Not open for further replies.

niena?t

User
Joined
Sep 14, 2008
Messages
24
Reaction score
3
Witam!
Zak?adam sw?j ots i potrzebuje osoby kt?ra zrobi my par? skrypt?w co? jak anihilator tylko ?e na 6 itp. Kontak GG:6125198.
 

Meferot

Advanced User
Joined
May 5, 2008
Messages
232
Reaction score
9
Age
32
Odp: Questy podobne do anhi.

PHP:
local playerPosition =
{
	{x = 247, y = 659, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 660, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 661, z = 13, stackpos = STACKPOS_TOP_CREATURE},
	{x = 247, y = 662, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
	{x = 189, y = 650, z = 13},
 	{x = 189, y = 651, z = 13},
	{x = 189, y = 652, z = 13},
	{x = 189, y = 653, z = 13}
}

To fragment scryptu z TFS, dzia?a z tego co si? orientuj? pod ka?d? wersj? silnika.
Znajduje si? w:
data/actions/quests/

Wystarczy ?e dopiszesz nowe wsp??rz?dne i zmienisz:
for i = 1, 4 do
na
for i = 1, 6 do
 

niena?t

User
Joined
Sep 14, 2008
Messages
24
Reaction score
3
Odp: Questy podobne do anhi.

To skrypt zwyk?ego annihilatora. lecz on tak?e mi nie dzia?a.Je?li b?d? mia? dobry ten skrypt to z reszt? sobie ju? poradz?.

local starting= {x = 1658, y = 338, z = 13} -- edit this to the top left sqm of ur annhilator room
local ending= {x = 1663, y = 344, z = 13} -- edit this to the bottom right sqm of ur annhilator room
local playerPosition = { -- oldPositions; positions of players before they get teleported.
{x = 1661, y = 351, z = 13},
{x = 1660, y = 351, z = 13},
{x = 1659, y = 351, z = 13},
{x = 1658, y = 351, z = 13}
}
local newPlayerPosition = { -- Positions for where players should be teleported, make sure it's in the same order as oldPositions
{x = 1662, y = 341, z = 13},
{x = 1661, y = 341, z = 13},
{x = 1660, y = 341, z = 13},
{x = 1659, y = 341, z = 13}
}
local creaturePosition = { -- Name and position of monsters to summon.
{"Demon", {x = 1659, y = 339, z = 13}},
{"Demon", {x = 1661, y = 339, z = 13}},
{"Demon", {x = 1660, y = 343, z = 13}},
{"Demon", {x = 1662, y = 343, z = 13}},
{"Demon", {x = 1664, y = 341, z = 13}},
{"Demon", {x = 1663, y = 341, z = 13}}
}
if(#playerPosition ~= #newPlayerPosition) then
error("Annhilator has not been properly configured.")
end
--- Preferably, do not edit anything below this line unless you know exactly what you are doing.
local player = {}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.uid == 5000) then --- change to different item.uid according to ur mapeditor
if(item.itemid == 1945) then
for i, position in ipairs(playerPosition) do -- add player id's to table
player = getTopCreature(Pos)
end
local ret, players = checkPlayers(cid)
if(ret) then
local ret, player = checkLevel(100)
if(ret) then
local ret, player = checkStorage(100)
if(ret) then
summonCreatures(creaturePosition)
teleportPlayers(2, 10) -- 2 stands for the effect on old position, 10 for the effect on new position.
doTransformItem(item.uid, 1946)
else
sendPlayersText(players, getPlayerName(player) .. " has already done this quest.")
end
else
sendPlayersText(players, getPlayerName(player) .. " is too low.")
end
else
sendPlayersText(players, "You need " .. #playerPosition .. " players to do this quest.")
end
elseif(item.itemid == 1946) then -- preferably, to be the id of the lever added by mapeditor.
if(cleanArea()) then
doTransformItem(item.uid, 1945)
else
return FALSE
end
end
return TRUE
--- Chests.
elseif(item.uid == 5001) then -- demon armor
return questChestPrize(cid, 2494, 100)
elseif(item.uid == 5002) then -- magic sword
return questChestPrize(cid, 2400, 100)
elseif(item.uid == 5003) then -- stonecutter's axe
return questChestPrize(cid, 2431, 100)
elseif(item.uid == 5004) then -- present box
return questChestPrize(cid, 1990, 100)
end
end
function sendPlayersText(players, text)
for _, player in ipairs(players) do
doPlayerSendCancel(player, text)
end
end
function questChestPrize(cid, itemid, storage)
if(getPlayerStorageValue(cid, storage) < TRUE) then
doPlayerAddItem(cid, itemid, 1)
setPlayerStorageValue(cid, storage, TRUE)
local item = getItemDescriptions(itemid)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found " .. item.article .. " " .. item.name .. "")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
return TRUE
end
function checkLevel(minLevel)
for _, player in ipairs(player) do
if(getPlayerLevel(player) < minLevel) then
return false, player
end
end
return true
end
function checkStorage(storageValue)
for _, player in ipairs(player) do
if(getPlayerStorageValue(player, storageValue) ~= TRUE) then
return false, player
end
end
return true
end
function cleanArea()
local checking= {x = starting.x, y = starting.y, z = starting.z, stackpos = 253}
local monster = {}
while(checking.y <= ending.y) do
local creature = getTopCreature(checking)
if(isCreature(creature) == TRUE) then
if(isPlayer(creature) == TRUE) then
return false
else
table.insert(monster, creature)
end
end
if(checking.x == ending.x) then
checking.x = starting.x
checking.y = checking.y + 1
end
checking.x = checking.x + 1
end
for i, c in ipairs(monster) do
doRemoveCreature(c)
end
return true
end
function summonCreatures(parameters)
for _, monster in ipairs(parameters) do
doCreateMonster(monster[1], monster[2])
end
end
function teleportPlayers(effect1, effect2)
for currentPlayer = 1, table.getn(player) do
doTeleportThing(player[currentPlayer], newPlayerPosition[currentPlayer])
doSendMagicEffect(playerPosition[currentPlayer], effect1) -- send animation after teleport, players teleported won't see it anyways
doSendMagicEffect(newPlayerPosition[currentPlayer], effect2)
end
end
function checkPlayers(cid)
local ret = {}
table.insert(ret, cid)
for _, curPlayer in ipairs(player) do
if(isPlayer(curPlayer) == TRUE) then
if(curPlayer ~= cid) then
table.insert(ret, curPlayer)
end
else
return false, ret
end
end
return true, ret
end

Mam taki skrypt nie wiem czy jest dobry. Jedna z?a rzecz to to ?e nie dzia?a tutaj wajcha. reszta chyba jest git bo nie mam b??d?w w silniku.
Wyt?umacz? jaki jest b??d.
Staje 4 player?w jeden poci?ga za d?wignie i nic. wszystko w uniqueid itp jest .
 
Last edited:
Status
Not open for further replies.
Top