Ir para conteúdo
  • 0

Preciso De Ajuda Urgente! Demon Oak Script -- Pedido Simples


Pergunta

PESSOAL, PRECISA APENAS POR QUE PARA CORTA A ARVORE DA DEMON OAK ALÉM DE PRECISAR SER LEVEL 120 COMO JÁ ESTA CONFIGURA QUE TENHA A STORAGE DA DEMON TASK. ACHO QUE VOCêS PODE ME AJUDAR FACILMENTE =)

 

 

local oneByQuest = true

local level = 120

local positions =

{

kick = { x = 32718, y = 32340, z = 7 },

summon =

{

{x=32713, y=32348, z=7},

{x=32720, y=32349, z=7},

{x=32720, y=32354, z=7},

{x=32711, y=32353, z=7}

}

}

 

local summons =

{

[1] = {"Demon", "Grim Reaper", "Elder Bonelord", "Demon Skeleton"},

[2] = {"Dark Torturer", "Banshee", "Betrayed Wraith", "Blightwalker"},

[3] = {"Bonebeast", "Braindeath", "Diabolic Imp", "Giant Spider"},

[4] = {"Hand of Cursed Fate", "Lich", "Undead Dragon", "Vampire"},

[5] = {"braindeath", "Demon", "Bonebeast", "Diabolic Imp"},

[6] = {"Demon Skeleton", "Banshee", "Elder Bonelord", "Bonebeast"},

[7] = {"Dark Torturer", "Undead Dragon", "Demon", "Demon"},

[8] = {"Elder Bonelord", "Betrayed Wraith", "Demon Skeleton", "Giant Spider"},

[9] = {"Demon", "Banshee", "Blightwalker", "Demon Skeleton"},

[10] = {"Grim Reaper", "Demon", "Diabolic Imp", "Braindeath"},

[11] = {"Banshee", "Grim Reaper", "Hand of Cursed fate", "Demon"}

}

 

local areaPosition =

{

{x=32709, y=32347, z=7, stackpos = 255},

{x=32725, y=32355, z=7, stackpos = 255}

}

 

local demonOak = {8288, 8289, 8290, 8291}

 

local storages =

{

cutTree = 36901

}

 

local blockingTree =

{

[2709] = {32193, 3669}

}

 

local floorDamage =

{

min = 270,

max = 310,

type = COMBAT_EARTHDAMAGE,

effect = CONST_ME_BIGPLANTS

}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

if blockingTree[itemEx.itemid] and itemEx.uid == blockingTree[itemEx.itemid][1] then

 

local tree = toPosition

if isInRange(tree, areaPosition[1], areaPosition[2]) then

print("[Warning - Event::Demon Oak Script] Dead tree position is inside the quest area positions.\nDead tree position (x: " .. tree.x .. ", y: " .. tree.y .. ", z: " .. tree.z .. ")\nNorth-West area position (x: " .. areaPosition[1].x .. ", y: " .. areaPosition[1].y .. ", z: " .. areaPosition[1].z .. ")\nSouth-West area position (x: " .. areaPosition[2].x .. ", y: " .. areaPosition[2].y .. ", z: " .. areaPosition[2].z .. ")\nScript will not work correctly, please fix it.")

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Something is wrong, please contact a gamemaster.")

return true

end

 

if getPlayerLevel(cid) < level then

doPlayerSendCancel(cid, "You need level " .. level .. " or higher to enter in the quest area.")

return true

end

 

if getCreatureStorage(cid, storages.done) > 0 then

doPlayerSendCancel(cid, "You already done this quest.")

return true

end

 

if getCreatureStorage(cid, storages.cutTree) > 0 then return false end

 

if oneByQuest then

local players = getPlayersOnline()

for _, pid in ipairs(players) do

if isInRange(getCreaturePosition(pid), areaPosition[1], areaPosition[2]) then

doPlayerSendCancel(cid, "Wait until " .. getCreatureName(pid) .. " finish the quest.")

return true

end

end

end

 

doTransformItem(itemEx.uid, blockingTree[itemEx.itemid][2])

doSendMagicEffect(toPosition, CONST_ME_POFF)

doMoveCreature(cid, SOUTH)

doCreatureSetStorage(cid, storages.cutTree, 1)

return true

 

elseif isInArray(demonOak, itemEx.itemid) then

 

local get = getCreatureStorage(cid, itemEx.itemid)

if get == -1 then doCreatureSetStorage(cid, itemEx.itemid, 1) end

 

local k = 0

for i = 8288, 8291 do

if(getCreatureStorage(cid, i) == 12) then

k = k + 1

end

end

if(k == 4) then

if getCreaturesInRange(monster, areaPosition[1], areaPosition[2], count) > 0 then

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please kill all monsters first.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

end

 

doTeleportThing(cid, positions.kick)

doCreatureSetStorage(cid, storages.done, 1)

return true

end

 

if getCreatureStorage(cid, itemEx.itemid) > 11 then

doSendMagicEffect(toPosition, CONST_ME_POFF)

return true

end

 

if(math.random(100) == 1) then

doCreatureSetStorage(cid, itemEx.itemid, 12)

return true

end

 

 

if summons[get] then

for i = 1, #summons[get] do

doCreateMonster(summons[get], positions.summon)

end

doSendMagicEffect(toPosition, CONST_ME_DRAWBLOOD)

doCreatureSetStorage(cid, itemEx.itemid, get + 1)

if math.random(100) >= 50 then

doTargetCombatHealth(0, cid, floorDamage.type, -floorDamage.min, -floorDamage.max, floorDamage.effect)

end

end

return false

end

end

 

function getCreaturesInRange(type, fromPos, toPos, get)

 

local types =

{

["player"] = isPlayer,

["monster"] = isMonster,

["npc"] = isNpc,

["creature"] = isCreature

}

local tmp = {}

 

local type = types[type]

if(not type) then return print("[Warning - Function::getCreaturesInRange] Unknow type " .. (type and type or "")) end

 

local thing = nil

for x = fromPos.x, toPos.x do

for y = fromPos.y, toPos.y do

for z = fromPos.z, toPos.z do

for s = 1, 253 do

local position = {x = x, y = y, z = z, stackpos = s}

thing = getTileThingByPos(position)

if(type(thing.uid) == true) then

table.insert(tmp, thing.uid)

end

end

end

end

end

if(get == "count") then

return table.maxn(tmp)

elseif(get == "name") then

return tmp

else

print("[Warning - Function::getCreaturesInRange] Unknow type to get " .. (get and get or ""))

end

end

Editado por TkSamer
Link para o comentário
https://xtibia.com/forum/topic/190679-preciso-de-ajuda-urgente-demon-oak-script-pedido-simples/
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

a arvore para entrar ou a que sai os bixos?

 

pronto tenta assim. so muda os bixos. eas pos.



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

local monster1 = "Crypt Shambler"
local monster2 = "Lich"
local monster3 = "bone beast"
local monster4 = "banshee"
local monster5 = "giant spider"
local boss1 = "Blightwalker"
local boss2 = "Betrayed Wraith"
local boss3 = "diabolic imp"
local boss4 = "demon"

basepos = {x=1867, y=975, z=7}
local starting={x=1856, y=966, z=7, stackpos=253}
local ending={x=1883, y=982, z=7, stackpos=253}
local trash= {x=1169, y=725, z=13}

--Alternative Monsters---------------------------------------------------------------
local altmo = 0 -- If it 0 monsters not randomize. If it 1 randomize with this \/

local altmonst1 = "braindeath"
local altmonst2 = "necromancer"
local altmonst3 = "vampire"
local altmonst4 = "giant spider"
local altmonst5 = "demon skeleton"
local altboss1  = "plaguesmith"
local altboss2  = "phantasm"
local altboss3  = "hellhound"
local altboss4  = "behemoth"

-----------------------------------------------------------------------------------------------
if altmo == 1 then
	if math.random (1,5) == 1 or math.random (1,5) == 5 then
			monster1 = altmonst1
			monster2 = altmonst2
			monster5 = altmonst5
			boss1 = altboss1
			boss3 = altboss3
	else
			monster3 = altmonst3
			monster4 = altmonst4
			boss2 = altboss2
			boss4 = altboss4
	end
end

local fourposition1 = {x=basepos.x-4, y=basepos.y-4, z=7}
local fourposition2 = {x=basepos.x-4, y=basepos.y+1, z=7}
local fourposition3 = {x=basepos.x+3, y=basepos.y-4, z=7}
local fourposition4 = {x=basepos.x+3, y=basepos.y+1, z=7}
local modpos1 = {x=basepos.x-3, y=basepos.y-5, z=7}
local modpos2 = {x=basepos.x, y=basepos.y-4, z=7}
local modpos3 = {x=basepos.x+2, y=basepos.y-5, z=7}
local threeposition1 = {x=basepos.x+3, y=basepos.y+4, z=7}
local threeposition2 = {x=basepos.x+5, y=basepos.y+4, z=7}
local threeposition3 = {x=basepos.x+3, y=basepos.y+5, z=7}
local twopos ={x=basepos.x+5, y=basepos.y+1, z=7}
local twopos1 = {x=basepos.x+2, y=basepos.y+2, z=7}
local doublepos = {x=basepos.x-3, y=basepos.y-1, z=7}
local leftpos = {x=basepos.x-4, y=basepos.y-5, z=7}
local crepos = {x=basepos.x-3, y=basepos.y-7, z=7}
local gopos = {x=basepos.x-2, y=basepos.y-17, z=7}
------------------------------------------------------------------------------------------------------------------------------
local gtotal = getPlayerStorageValue(cid, 15005)
local gcorvo = getPlayerStorageValue(cid, 15001)
local gleft = getPlayerStorageValue(cid, 15002)
local gright = getPlayerStorageValue(cid, 15003)
local gface = getPlayerStorageValue(cid, 15004)
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}

	if item2.itemid == 2717 and item2.uid == 32193 then
			if getPlayerLevel(cid) >= 120  then
					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
																			current=0
																			repeat
																					current=current+1
																					doTeleportThing(monster[current],trash)
																			until current>=totalmonsters
			doTeleportThing(cid, topos, 0)
			setPlayerMultiplyStorageValues(cid,{15001,15002,15003,15004},1)
			doTransformItem(item2.uid, 3669)
			doCreateTeleport(1387, gopos, crepos)
			local getrem1 = getThingfromPos({x=basepos.x-3, y=basepos.y-7, z=7, stackpos = 3})
			doSetItemActionId(getrem1.uid,32195)
																	end
			else
					doPlayerSendTextMessage(cid, "You need level 120 to enter in arena.", result)
			end

	elseif item2.itemid == 8288 then
			if gcorvo <10 then
					effect (cid,15001,gcorvo,topos)
							if gcorvo == 3 then
									doSummonCreatures(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gcorvo == 5 then
									doSummonCreatures(monster2, {threeposition1,threeposition2,threeposition3})
							elseif gcorvo == 7 then
									doSummonCreature(boss1, fourposition3)
							elseif gcorvo == 9 then
									gtotal = gtotal + 1
									setPlayerStorageValue(cid, 15005,gtotal)
							end
			else
					doSendMagicEffect(topos, 2)
			end

	elseif item2.itemid == 8289 then
			if gleft <10 then
					effect (cid,15002,gleft,topos)
							if gleft == 3 then
									doSummonCreature(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gleft == 4 then
									doSummonCreatures(monster3, {modpos1,modpos2,modpos3})
									doSummonCreature(monster3, fourposition2)
							elseif gleft == 7 then
									doSummonCreatures(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gleft == 9 then
									doSummonCreature(boss2, leftpos)
									gtotal = gtotal + 1
									setPlayerStorageValue(cid, 15005,gtotal)
							end
			else
					doSendMagicEffect(topos, 2)
			end

	elseif item2.itemid == 8290 then
			if gright <10 then
					effect (cid,15003,gright,topos)
							if gright == 2 then
									doSummonCreatures(monster4, {twopos,twopos1})
							elseif gright == 4 then
									doSummonCreatures(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gright == 7 then
									doSummonCreatures(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gright == 9 then
									doSummonCreature(boss3,leftpos)
									gtotal = gtotal + 1
									setPlayerStorageValue(cid, 15005,gtotal)
							end
			else
					doSendMagicEffect(topos, 2)
			end

	elseif item2.itemid == 8291 then
			if gface <10 then
					effect (cid,15004,gface,topos)
							if gface == 1 then
									doSummonCreature(monster2, doublepos)
									doSummonCreature(monster5, fourposition2)
							elseif gface == 4 then
									doSummonCreatures(monster1, {fourposition1,fourposition2,fourposition3,fourposition4})
							elseif gface == 6 then
									doSummonCreature(boss4, leftpos)
							elseif gface == 9 then
									gtotal = gtotal + 1
									setPlayerStorageValue(cid, 15005,gtotal)
							end
			else
					doSendMagicEffect(topos, 2)
			end
	end
end

local function effect (cid,storage,valor,topos)
	valor = getPlayerStorageValue(cid, storage)
	doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -300, -300, CONST_ME_BIGPLANTS)
	valor = valor + 1
	setPlayerStorageValue(cid, storage,valor)
	doSendMagicEffect(topos, 0)
end

Editado por Tchubaka
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...