Jump to content
  • 0
lepiigor

Scripting Grizzly Adams [Boss Access]

Question

lepiigor
Posted (edited)

Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:

https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/

https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/

Obs: não delete esse formulário pré-definido, preencha-o corretamente para postar o seu tópico!

Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).

Base:

OtservBR 12.64

Qual é a sua pergunta?

Olá O grizzly adams dá a tarefa sem problemas, o xp e o storage (testado com outro NPC para removê-lo) No MAP existe claro no Teleport o storage do script correspondente ao boss, porque quando passamos por cima não temos acesso? Não consigo deduzir o que está errado

 

Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:

 

Lib/killing in the name of

Spoiler
--[[
TODO
Unite all related variables/functions in a table
rewrite functions like "getTasksByPlayer" to "Player.getTasks"
]]

RANK_NONE = 0
RANK_JOIN = 1
RANK_HUNTSMAN = 2
RANK_RANGER = 3
RANK_BIGGAMEHUNTER = 4
RANK_TROPHYHUNTER = 5
RANK_ELITEHUNTER = 6

REWARD_MONEY = 1
REWARD_EXP = 2
REWARD_ACHIEVEMENT = 3
REWARD_STORAGE = 4
REWARD_POINT = 5
REWARD_ITEM = 6

QUESTSTORAGE_BASE = 1500
JOIN_STOR = 100157
KILLSSTORAGE_BASE = 65000
REPEATSTORAGE_BASE = 48950
POINTSSTORAGE = 2500
tasks =
{
	[1] = {
		killsRequired = 100,
		raceName = "Trolls",
		level = {6, 19},
		premium = true,
		creatures = {
			"troll",
			"troll champion",
			"island troll",
			"swamp troll"
		},
		rewards = {
			{type = "exp", value = {65000}},
			{type = "money", value = {2000}}
		}
	},
	[2] = {
		killsRequired = 150,
		raceName = "Goblins",
		level = {6, 19},
		premium = true,
		creatures = {
			"goblin",
			"goblin assassin",
			"goblin leader"
		},
		rewards = {
			{type = "exp", value = {125000}},
			{type = "money", value = {2500}}
		}
	},
	[3] = {
		killsRequired = 300,
		raceName = "Crocodiles",
		level = {6, 49},
		premium = true,
		creatures = {
			"crocodile"
		},
		rewards = {
			{type = "exp", value = {400000}},
			{type = "achievement", value = {"Blood-Red Snapper"}},
			{type = "storage", value = {34100, 1}},
			{type = "points", value = {1}}
		}
	},
	[4] = {
		killsRequired = 300,
		raceName = "Badgers",
		level = {6, 49},
		premium = true,
		creatures = {
			"badger"
		},
		rewards = {
			{type = "exp", value = {150000}},
			{type = "points", value = {1}}
		}
	},
	[5] = {
		killsRequired = 300,
		raceName = "Tarantulas",
		level = {6, 49},
		premium = true,
		creatures = {
			"tarantula"
		},
		rewards = {
			{type = "exp", value = {850000}},
			{type = "achievement", value = {"No More Hiding"}},
			{type = "storage", value = {34101, 1}},
			{type = "points", value = {2}}
		}
	},
	[6] = {
		killsRequired = 150,
		raceName = "Carniphilas",
		level = {6, 999},
		premium = true,
		creatures = {
			"carniphila"
		},
		rewards = {
			{type = "exp", value = {850000}},
			{type = "achievement", value = {"Rootless Behaviour"}},
			{type = "storage", value = {34102, 1}},
			{type = "points", value = {3}}
		}
	},
	[7] = {
		killsRequired = 200,
		raceName = "Stone Golems",
		level = {6, 49},
		premium = true,
		creatures = {
			"stone golem"
		},
		rewards = {
			{type = "exp", value = {1000000}},
			{type = "points", value = {3}}
		}
	},
	[8] = {
		killsRequired = 300,
		raceName = "Mammoths",
		level = {6, 49},
		premium = true,
		creatures = {
			"mammoth"
		},
		rewards = {
			{type = "exp", value = {1100000}},
			{type = "achievement", value = {"Meat Skewer"}},
			{type = "storage", value = {34103, 1}},
			{type = "points", value = {3}}
		}
	},
	[9] = {
		killsRequired = 300,
		raceName = "Gnarlhounds",
		level = {6, 49},
		premium = true,
		creatures = {
			"gnarlhound"
		},
		rewards = {
			{type = "exp", value = {850000}},
			{type = "points", value = {2}}
		}
	},
	[10] = {
		killsRequired = 300,
		raceName = "Terramites",
		level = {6, 49},
		premium = true,
		creatures = {
			"terramite"
		},
		rewards = {
			{type = "exp", value = {1440000}},
			{type = "points", value = {2}}
		}
	},
	[11] = {
		killsRequired = 300,
		raceName = "Apes",
		level = {6, 49},
		premium = true,
		creatures = {
			"kongra",
			"sibang",
			"merklin"
		},
		rewards = {
			{type = "exp", value = {1050000}},
			{type = "points", value = {2}}
		}
	},
	[12] = {
		killsRequired = 300,
		raceName = "Thornback Tortoises",
		level = {6, 49},
		premium = true,
		creatures = {
			"thornback tortoise"
		},
		rewards = {
			{type = "exp", value = {1350000}},
			{type = "points", value = {2}}
		}
	},
	[13] = {
		killsRequired = 300,
		raceName = "Gargoyles",
		level = {6, 49},
		premium = true,
		creatures = {
			"gargoyle"
		},
		rewards = {
			{type = "exp", value = {1350000}}
		}
	},
	[14] = {
		killsRequired = 300,
		raceName = "Ice Golems",
		level = {50, 79},
		premium = true,
		creatures = {
			"ice golem"
		},
		rewards = {
			{type = "exp", value = {1200000}},
			{type = "achievement", value = {"Breaking The Ice"}},
			{type = "storage", value = {34104, 1}},
			{type = "points", value = {2}}
		}
	},
	[15] = {
		killsRequired = 400,
		raceName = "Quara Scouts",
		level = {50, 999},
		premium = true,
		creatures = {
			"quara pincher scout",
			"quara predator scout",
			"quara hydromancer scout",
			"quara constrictor scout",
			"quara mantassin scout"
		},
		rewards = {
			{type = "exp", value = {2000000}},
			{type = "points", value = {2}}
		}
	},
	[16] = {
		killsRequired = 400,
		raceName = "Mutated Rats",
		level = {50, 999},
		premium = true,
		creatures = {
			"mutated rat"
		},
		rewards = {
			{type = "exp", value = {2500000}},
			{type = "achievement", value = {"Twisted Mutation"}},
			{type = "storage", value = {34105, 1}},
			{type = "points", value = {2}}
		}
	},
	[17] = {
		killsRequired = 250,
		raceName = "Ancient Scarabs",
		level = {50, 999},
		premium = true,
		creatures = {
			"ancient scarab"
		},
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "achievement", value = {"Crawling Death"}},
			{type = "storage", value = {34106, 1}},
			{type = "points", value = {2}}
		}
	},
	[18] = {
		killsRequired = 300,
		raceName = "Wyverns",
		level = {50, 999},
		premium = true,
		creatures = {
			"wyvern"
		},
		rewards = {
			{type = "exp", value = {3500000}},
			{type = "points", value = {2}}
		}
	},
	[19] = {
		killsRequired = 300,
		raceName = "Lancer Beetles",
		level = {50, 79},
		premium = true,
		creatures = {
			"lancer beetle"
		},
		rewards = {
			{type = "exp", value = {2000000}},
			{type = "points", value = {2}}
		}
	},
	[20] = {
		killsRequired = 400,
		raceName = "Wailing Widows",
		level = {50, 999},
		premium = true,
		creatures = {
			"wailing widow"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "points", value = {3}}
		}
	},
	[21] = {
		killsRequired = 250,
		raceName = "Killer Caimans",
		level = {50, 999},
		premium = true,
		creatures = {
			"killer caiman"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "points", value = {2}}
		}
	},
	[22] = {
		killsRequired = 300,
		raceName = "Bonebeasts",
		level = {50, 999},
		premium = true,
		creatures = {
			"bonebeast"
		},
		rewards = {
			{type = "exp", value = {1500000}},
			{type = "achievement", value = {"Spareribs for Dinner"}},
			{type = "storage", value = {34107, 1}},
			{type = "points", value = {2}}
		}
	},
	[23] = {
		killsRequired = 300,
		raceName = "Crystal Spiders",
		level = {50, 999},
		creatures = {
		"crystal spider"},
		premium = true,
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "achievement", value = {"Arachnoise"}},
			{type = "storage", value = {34108, 1}},
			{type = "points", value = {3}}
		}
	},
	[24] = {
		killsRequired = 300,
		raceName = "Mutated Tigers",
		level = {50, 999},
		premium = true,
		creatures = {
			"mutated tiger"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "points", value = {2}}
		}
	},
	[25] = {
		killsRequired = 600,
		raceName = "Underwater Quara",
		level = {80, 999},
		premium = true,
		creatures = {
			"quara hydromancer",
			"quara predator",
			"quara constrictor",
			"quara mantassin",
			"quara pincher"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "achievement", value = {"Back into the Abyss"}},
			{type = "storage", value = {34109, 1}},
			{type = "points", value = {3}}
		}
	},
	[26] = {
		killsRequired = 500,
		raceName = "Giant Spiders",
		level = {80, 999},
		premium = true,
		creatures = {
			"giant spider"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "achievement", value = {"Choking on Her Venom"}},
			{type = "storage", value = {34110, 1}},
			{type = "points", value = {3}}
		}
	},
	[27] = {
		killsRequired = 300,
		raceName = "Werewolves",
		level = {80, 999},
		premium = true,
		creatures = {
			"werewolf"
		},
		rewards = {
			{type = "exp", value = {1050000}},
			{type = "achievement", value = {"Howly Silence"}},
			{type = "storage", value = {34111, 1}},
			{type = "points", value = {4}}
		}
	},
	[28] = {
		killsRequired = 400,
		raceName = "Nightmares",
		level = {80, 999},
		premium = true,
		creatures = {
			"nightmare",
			"nightmare scion"
		},
		rewards = {
			{type = "exp", value = {2500000}},
			{type = "achievement", value = {"Dream is Over"}},
			{type = "storage", value = {34112, 1}},
			{type = "points", value = {3}}
		}
	},
	[29] = {
		killsRequired = 600,
		raceName = "Hellspawns",
		level = {80, 999},
		premium = true,
		creatures = {
			"hellspawn"
		},
		rewards = {
			{type = "exp", value = {6000000}},
			{type = "achievement", value = {"Scorched Flames"}},
			{type = "storage", value = {34113, 1}}
		}
	},
	[30] = {
		killsRequired = 800,
		raceName = "High Class Lizards",
		level = {80, 999},
		premium = true,
		creatures = {
			"lizard chosen",
			"lizard dragon priest",
			"lizard high guard",
			"lizard legionnaire"
		},
		rewards = {
			{type = "exp", value = {8000000}},
			{type = "achievement", value = {"Zzztill Zzztanding!"}},
			{type = "storage", value = {34114, 1}},
			{type = "points", value = {3}}
		}
	},
	[31] = {
		killsRequired = 600,
		raceName = "Stampors",
		level = {80, 999},
		premium = true,
		creatures = {
			"stampor"
		},
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "achievement", value = {"Stepped on a Big Toe"}},
			{type = "storage", value = {34115, 1}},
			{type = "points", value = {3}}
		}
	},
	[32] = {
		killsRequired = 500,
		raceName = "Brimstone Bugs",
		level = {80, 999},
		premium = true,
		creatures = {
			"brimstone bug"
		},
		rewards = {
			{type = "exp", value = {3000000}},
			{type = "achievement", value = {"Something Smells"}},
			{type = "storage", value = {34116, 1}},
			{type = "points", value = {3}}
		}
	},
	[33] = {
		killsRequired = 400,
		raceName = "Mutated Bats",
		level = {80, 999},
		premium = true,
		creatures = {
			"mutated bat"
		},
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "achievement", value = {"Kapow!"}},
			{type = "storage", value = {34117, 1}},
			{type = "points", value = {2}}
		}
	},
	[34] = {
		killsRequired = 650,
		raceName = "Hydras",
		level = {130, 9999},
		premium = true,
		creatures = {
			"hydra"
		},
		rewards = {
			{type = "exp", value = {8000000}},
			{type = "achievement", value = {"One Less"}},
			{type = "storage", value = {34118, 1}},
			{type = "points", value = {3}}
		}
	},
	[35] = {
		killsRequired = 800,
		raceName = "Serpent Spawns",
		level = {130, 9999},
		premium = true,
		creatures = {
			"serpent spawn"
		},
		rewards = {
			{type = "exp", value = {8500000}},
			{type = "achievement", value = {"Hissing Downfall"}},
			{type = "storage", value = {34119, 1}},
			{type = "points", value = {4}}
		}
	},
	[36] = {
		killsRequired = 500,
		raceName = "Medusas",
		level = {130, 9999},
		premium = true,
		creatures = {
			"medusa"
		},
		rewards = {
			{type = "exp", value = {9500000}},
			{type = "achievement", value = {"The Serpent's Bride"}},
			{type = "storage", value = {34120, 1}},
			{type = "points", value = {5}}
		}
	},
	[37] = {
		killsRequired = 700,
		raceName = "Behemoths",
		level = {130, 9999},
		premium = true,
		creatures = {
			"behemoth"
		},
		rewards = {
			{type = "exp", value = {8000000}},
			{type = "achievement", value = {"Just Cracked Me Up!"}},
			{type = "storage", value = {34121, 1}},
			{type = "points", value = {4}}
		}
	},
	[38] = {
		killsRequired = 900,
		raceName = "Sea Serpents and Young Sea Serpents",
		level = {130, 9999},
		premium = true,
		creatures = {
			"sea serpent",
			"young sea serpent"
		},
		rewards = {
			{type = "exp", value = {12000000}},
			{type = "achievement", value = {"The Drowned Sea God"}},
			{type = "storage", value = {34122, 1}},
			{type = "points", value = {4}}
		}
	},
	[39] = {
		killsRequired = 250,
		raceName = "Hellhounds",
		level = {130, 9999},
		premium = true,
		creatures = {
			"hellhound"
		},
		rewards = {
			{type = "exp", value = {10000000}},
			{type = "achievement", value = {"The Gates of Hell"}},
			{type = "storage", value = {34123, 1}},
			{type = "points", value = {5}}
		}
	},
	[40] = {
		killsRequired = 500,
		raceName = "Ghastly Dragons",
		level = {130, 9999},
		premium = true,
		creatures = {
			"ghastly dragon"
		},
		rewards = {
			{type = "exp", value = {15000000}},
			{type = "achievement", value = {"Beautiful Agony"}},
			{type = "storage", value = {34124, 1}},
			{type = "points", value = {5}}
		}
	},
	[41] = {
		killsRequired = 900,
		raceName = "Drakens",
		level = {130, 9999},
		premium = true,
		creatures = {
			"draken spellweaver",
			"draken warmaster",
			"draken abomination",
		"draken elite"} ,
		rewards = {
			{type = "exp", value = {11000000}},
			{type = "achievement", value = {"Enter zze Draken!"}},
			{type = "storage", value = {34125, 1}},
			{type = "points", value = {3}}
		}
	},
	[42] = {
		killsRequired = 650,
		raceName = "Destroyers",
		level = {130, 9999},
		premium = true,
		creatures = {
			"destroyer"
		},
		rewards = {
			{type = "exp", value = {7000000}},
			{type = "achievement", value = {"Best there was!"}},
			{type = "storage", value = {34126, 1}},
			{type = "points", value = {4}}
		}
	},
	[43] = {
		killsRequired = 400,
		raceName = "Undead Dragons",
		level = {130, 9999},
		premium = true,
		creatures = {
			"undead dragon"
		},
		rewards = {
			{type = "exp", value = {10000000}},
			{type = "achievement", value = {"Back from the Dead"}},
			{type = "storage", value = {34127, 1}},
			{type = "points", value = {6}}
		}
	},
	[44] = {
		killsRequired = 6666,
		raceName = "Demons",
		level = {130, 9999}, rank = RANK_ELITEHUNTER,
		premium = true,
		creatures = {
			"demon"
		},
		rewards = {
			{type = "item", value = {10305, 1}},
			{type = "exp", value = {50000000}},
			{type = "storage", value = {41300, 1}}
		}
	},
	[45] = {
		killsRequired = 500,
		raceName = "Green Djinns or Efreets",
		level = {1, 9999}, storage = {12500, 1},
		premium = true,
		creatures = {
			"green djinn",
			"efreet"
		},
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "money", value = {5000}},
			{type = "storage", value = {34128, 1}}
		}
	},
	[46] = {
		killsRequired = 500,
		raceName = "Blue Djinns or Marids",
		level = {1, 9999}, storage = {12501, 1},
		premium = true,
		creatures = {
			"blue djinn",
			"marid"
		},
		rewards = {
			{type = "exp", value = {4000000}},
			{type = "money", value = {5000}},
			{type = "storage", value = {34129, 1}}
		}
	},
	[47] = {
		killsRequired = 3000,
		raceName = "Pirates",
		level = {1, 9999}, storage = {65047, 1},
		premium = true,
		creatures = {
			"pirate ghost",
			"pirate marauder",
			"pirate cutthroad",
			"pirate buccaneer",
			"pirate corsair",
			"pirate skeleton"
		},
		rewards = {
			{type = "exp", value = {7000000}},
			{type = "money", value = {5000}},
			{type = "storage", value = {17523, 1}}
		}
	},
	[48] = {
		killsRequired = 3000,
		raceName = "Pirates second task",
		level = {1, 9999}, storage = {REPEATSTORAGE_BASE + 47, 3}, norepeatable = true,
		premium = true,
		creatures = {
			"pirate ghost",
			"pirate marauder",
			"pirate cutthroad",
			"pirate buccaneer",
			"pirate corsair",
			"pirate skeleton"
		},
		rewards = {
			{type = "exp", value = {10000000}},
			{type = "money", value = {5000}},
			{type = "storage", value = {17523, 1}}
		}
	},
	[49] = {
		killsRequired = 5000,
		raceName = "Minotaurs",
		level = {1, 9999}, storage = {12700, 1}, norepeatable = true,
		premium = false,
		creatures = {
			"minotaur",
			"minotaur mage",
			"minotaur archer"
		},
		rewards = {
			{type = "storage", value = {17522, 1}},
			{type = "exp", value = {10000000}}
		}
	},
	[50] = {
		killsRequired = 4000,
		raceName = "Necromancers and Priestess",
		level = {60, 9999}, norepeatable = true,
		premium = true,
		creatures = {
			"necromancer",
			"priestess"
		},
		rewards = {
			{type = "storage", value = {34133, 1}},
			{type = "exp", value = {10000000}},
			{type = "storage", value = {17521, 1}}
		}
	},
	[51] = {
		killsRequired = 20,
		raceName = "Mountain Trolls",
		level = {1, 9999}, storage = {12701, 1}, norepeatable = true,
		premium = false,
		creatures = {
			"mountain trolls"
		},
		rewards = {
			{type = "storage", value = {17524, 1}}
		}
	},
	[52] = {
		killsRequired = 20,
		raceName = "Muglex Clan Footman",
		level = {1, 9999}, storage = {12702, 1}, norepeatable = true,
		premium = false,
		creatures = {
			"muglex clan footman "
		},
		rewards = {
			{type = "storage", value = {17525, 1}}
		}
	},
	[53] = {
		killsRequired = 20,
		raceName = "Minotaur Bruisers",
		level = {1, 9999}, storage = {12703, 1}, norepeatable = true,
		premium = false,
		creatures = {
			"minotaur bruisers"
		},
		rewards = {
			{type = "storage", value = {17526, 1}}
		}
	},
}

tasksByPlayer = 3
repeatTimes = 3

function Player.getPawAndFurRank(self)
	return (self:getStorageValue(POINTSSTORAGE) >= 100
	and RANK_ELITEHUNTER or self:getStorageValue(POINTSSTORAGE) >= 70
	and RANK_TROPHYHUNTER or self:getStorageValue(POINTSSTORAGE) >= 40
	and RANK_BIGGAMEHUNTER or self:getStorageValue(POINTSSTORAGE) >= 20
	and RANK_RANGER or self:getStorageValue(POINTSSTORAGE) >= 10
	and RANK_HUNTSMAN or self:getStorageValue(JOIN_STOR) == 1
	and RANK_JOIN or RANK_NONE)
end

function Player.getPawAndFurPoints(self)
	return math.max(self:getStorageValue(POINTSSTORAGE), 0)
end

function getTaskByName(name, table)
	local t = (table and table or tasks)
	for k, v in pairs(t) do
		if v.name then
			if v.name:lower() == name:lower() then
				return k
			end
		else
			if v.raceName:lower() == name:lower() then
				return k
			end
		end
	end
	return false
end

function Player.getTasks(self)
	local canmake = {}
	local able = {}
	for k, v in pairs(tasks) do
		if self:getStorageValue(QUESTSTORAGE_BASE + k) < 1 and self:getStorageValue(REPEATSTORAGE_BASE + k) < repeatTimes then
			able[k] = true
			if self:getLevel() < v.level[1] or self:getLevel() > v.level[2] then
				able[k] = false
			end
			if v.storage and self:getStorageValue(v.storage[1]) < v.storage[2] then
				able[k] = false
			end

			if v.rank then
				if self:getPawAndFurRank() < v.rank then
					able[k] = false
				end
			end

			if v.premium then
				if not self:isPremium() then
					able[k] = false
				end
			end

			if able[k] then
				canmake[#canmake + 1] = k
			end
		end
	end
	return canmake
end

function Player.canStartTask(self, name, table)
	local v = ""
	local id = 0
	local t = (table and table or tasks)
	for k, i in pairs(t) do
		if i.name then
			if i.name:lower() == name:lower() then
				v = i
				id = k
				break
			end
		else
			if i.raceName:lower() == name:lower() then
				v = i
				id = k
				break
			end
		end
	end
	if v == "" then
		return false
	end
	if self:getStorageValue(QUESTSTORAGE_BASE + id) > 0 then
		return false
	end
	if self:getStorageValue(REPEATSTORAGE_BASE +  id) >= repeatTimes or v.norepeatable and self:getStorageValue(REPEATSTORAGE_BASE +  id) > 0 then
		return false
	end
	if v.level and self:getLevel() >= v.level[1] and self:getLevel() <= v.level[2] then
		if v.premium then
			if self:isPremium() then
				if v.rank then
					if self:getPawAndFurRank() >= v.rank then
						if v.storage then
							if self:getStorageValue(v.storage[1]) >= v.storage then
								return true
							end
						else
							return true
						end
					end
				else
					return true
				end
			else
				return true
			end
		else
			return true
		end
	end
	return false
end

function Player.getStartedTasks(self)
	local tmp = {}
	for k, v in pairs(tasks) do
		if self:getStorageValue(QUESTSTORAGE_BASE + k) > 0 and self:getStorageValue(QUESTSTORAGE_BASE + k) < 2 then
			tmp[#tmp + 1] = k
		end
	end
	return tmp
end

function getPlayerRank(cid) local p = Player(cid) return p and p:getPawAndFurRank() end
function getPlayerTasksPoints(cid) local p = Player(cid) return p and p:getPawAndFurPoints() end
function getTasksByPlayer(cid) local p = Player(cid) return p and p:getTasks() end
function canStartTask(cid, name, table) local p = Player(cid) return p and p:canStartTask(name, table) end
function getPlayerStartedTasks(cid) local p = Player(cid) return p and p:getStartedTasks() end
 

 

 

script/mov/quest/killing in the name of / BOSS

Spoiler

local function roomIsOccupied(centerPosition,
        rangeX, rangeY)
    local spectators = Game.getSpectators(centerPosition, false, true,
        rangeX,
        rangeX, rangeY, rangeY)
    if #spectators ~= 0 then
        return true
    end
    return false
end

function clearBossRoom(playerId, bossId,
        centerPosition,
        rangeX, rangeY, exitPosition)
    local spectators, spectator = Game.getSpectators(centerPosition, false, false,
        rangeX,
        rangeX, rangeY, rangeY)
    for i = 1, #spectators do
        spectator = spectators
        if spectator:isPlayer() and spectator.uid == playerId then
            spectator:teleportTo(exitPosition)
            exitPosition:sendMagicEffect(CONST_ME_TELEPORT)
        end
        if spectator:isMonster() and spectator.uid == bossId then
            spectator:remove()
        end
    end
end

local bosses = {
    [3230] = {
        bossName = 'the snapper',
        storage = 34100,
        playerPosition = Position(32610, 32723, 8),
        bossPosition = Position(32617, 32732, 8),
        centerPosition = Position(32613, 32727, 8),
        rangeX = 5, rangeY = 5,
        flamePosition = Position(32612, 32733, 8)
    },
    [3231] = {
        bossName = 'hide',
        storage = 34101,
        playerPosition = Position(32815, 32703, 8),
        bossPosition = Position(32816, 32712, 8),
        centerPosition = Position(32816, 32707, 8),
        rangeX = 6, rangeY = 5,
        flamePosition = Position(32810, 32704, 8)
    },
    [3232] = {
        bossName = 'deathbine',
        storage = 34102,
        playerPosition = Position(32715, 32736, 8),
        bossPosition = Position(32714, 32713, 8),
        centerPosition = Position(32716, 32724, 8),
        rangeX = 9, rangeY = 13,
        flamePosition = Position(32726, 32727, 8)
    },
    [3233] = {
        bossName = 'the bloodtusk',
        storage = 34103,
        playerPosition = Position(32102, 31124, 2),
        bossPosition = Position(32102, 31134, 2),
        centerPosition = Position(32101, 31129, 2),
        rangeX = 5, rangeY = 6,
        flamePosition = Position(32093, 31130, 2)
    },
    [3234] = {
        bossName = 'shardhead',
        storage = 34104,
        playerPosition = Position(32152, 31137, 3),
        bossPosition = Position(32159, 31132, 3),
        centerPosition = Position(32155, 31136, 3),
        rangeX = 5, rangeY = 7,
        flamePosition = Position(32149, 31137, 3)
    },
    [3235] = {
        bossName = 'esmeralda',
        storage = 34105,
        playerPosition = Position(32759, 31252, 9),
        bossPosition = Position(32759, 31258, 9),
        centerPosition = Position(32759, 31254, 9),
        rangeX = 4, rangeY = 4,
        flamePosition = Position(32758, 31248, 9)
    },
    [3236] = {
        bossName = 'fleshcrawler',
        storage = 34106,
        playerPosition = Position(33100, 32785, 11),
        bossPosition = Position(33121, 32797, 11),
        centerPosition = Position(33112, 32789, 11),
        rangeX = 15, rangeY = 13,
        flamePosition = Position(33106, 32775, 11)
    },
    [3237] = {
        bossName = 'ribstride',
        storage = 34107,
        playerPosition = Position(33012, 32813, 13),
        bossPosition = Position(33013, 32801, 13),
        centerPosition = Position(33012, 32805, 13),
        rangeX = 10, rangeY = 9,
        flamePosition = Position(33018, 32814, 13)
    },
    [3238] = {
        bossName = 'the bloodweb',
        storage = 34108,
        playerPosition = Position(32019, 31037, 8),
        bossPosition = Position(32032, 31033, 8),
        centerPosition = Position(32023, 31033, 8),
        rangeX = 11, rangeY = 11,
        flamePosition = Position(32010, 31031, 8)
    },
    [3239] = {
        bossName = 'thul',
        storage = 34109,
        playerPosition = Position(32078, 32780, 13),
        bossPosition = Position(32088, 32780, 13),
        centerPosition = Position(32083, 32781, 13),
        rangeX = 6, rangeY = 6,
        flamePosition = Position(32086, 32776, 13)
    },
    [3240] = {
        bossName = 'the old widow',
        storage = 34110,
        playerPosition = Position(32805, 32280, 8),
        bossPosition = Position(32797, 32281, 8),
        centerPosition = Position(32801, 32276, 8),
        rangeX = 5, rangeY = 5,
        flamePosition = Position(32808, 32283, 8)
    },
    [3241] = {
        bossName = 'hemming',
        storage = 34111,
        playerPosition = Position(32999, 31452, 8),
        bossPosition = Position(33013, 31441, 8),
        centerPosition = Position(33006, 31445, 8),
        rangeX = 9, rangeY = 7,
        flamePosition = Position(33005, 31437, 8)
    },
    [3242] = {
        bossName = 'tormentor',
        storage = 34112,
        playerPosition = Position(32043, 31258, 11),
        bossPosition = Position(32058, 31267, 11),
        centerPosition = Position(32051, 31264, 11),
        rangeX = 11, rangeY = 14,
        flamePosition = Position(32051, 31249, 11)
    },
    [3243] = {
        bossName = 'flameborn',
        storage = 34113,
        playerPosition = Position(32940, 31064, 8),
        bossPosition = Position(32947, 31058, 8),
        centerPosition = Position(32944, 31060, 8),
        rangeX = 11, rangeY = 10,
        flamePosition = Position(32818, 31026, 7)
    },
    [3244] = {
        bossName = 'fazzrah',
        storage = 34114,
        playerPosition = Position(32993, 31175, 7),
        bossPosition = Position(33005, 31174, 7),
        centerPosition = Position(33003, 31177, 7),
        rangeX = 14, rangeY = 6,
        flamePosition = Position(33007, 31171, 7)
    },
    [3245] = {
        bossName = 'tromphonyte',
        storage = 34115,
        playerPosition = Position(33111, 31184, 8),
        bossPosition = Position(33120, 31195, 8),
        centerPosition = Position(33113, 31188, 8),
        rangeX = 11, rangeY = 18,
        flamePosition = Position(33109, 31168, 8)
    },
    [3246] = {
        bossName = 'sulphur scuttler',
        storage = 34116,
        playerPosition = Position(33269, 31046, 9),
        bossPosition = Position(33274, 31037, 9),
        centerPosition = Position(33088, 31012, 8),
        rangeX = 11, rangeY = 11,
        flamePosition = Position(0, 0, 0)
    },
    [3247] = {
        bossName = 'bruise payne',
        storage = 34117,
        playerPosition = Position(33237, 31006, 2),
        bossPosition = Position(33266, 31016, 2),
        centerPosition = Position(33251, 31016, 2),
        rangeX = 22, rangeY = 11,
        flamePosition = Position(33260, 31003, 2)
    },
    [3248] = {
        bossName = 'the many',
        storage = 34118,
        playerPosition = Position(32921, 32893, 8),
        bossPosition = Position(32926, 32903, 8),
        centerPosition = Position(32921, 32898, 8),
        rangeX = 5, rangeY = 6,
        flamePosition = Position(32921, 32890, 8)
    },
    [3249] = {
        bossName = 'the noxious spawn',
        storage = 34119,
        playerPosition = Position(32842, 32667, 11),
        bossPosition = Position(32843, 32675, 11),
        centerPosition = Position(32843, 32670, 11),
        rangeX = 5, rangeY = 5,
        flamePosition = Position(0, 0, 0)
    },
    [3250] = {
        bossName = 'gorgo',
        storage = 34120,
        playerPosition = Position(32759, 32447, 11),
        bossPosition = Position(32763, 32435, 11),
        centerPosition = Position(32759, 32440, 11),
        rangeX = 9, rangeY = 10,
        flamePosition = Position(32768, 32440, 11)
    },
    [3251] = {
        bossName = 'stonecracker',
        storage = 34121,
        playerPosition = Position(33259, 31694, 15),
        bossPosition = Position(33257, 31705, 15),
        centerPosition = Position(33259, 31670, 15),
        rangeX = 5, rangeY = 7,
        flamePosition = Position(33259, 31689, 15)
    },
    [3252] = {
        bossName = 'leviathan',
        storage = 34122,
        playerPosition = Position(31915, 31071, 10),
        bossPosition = Position(31903, 31072, 10),
        centerPosition = Position(31909, 31072, 10),
        rangeX = 8, rangeY = 7,
        flamePosition = Position(31918, 31071, 10)
    },
    [3253] = {
        bossName = 'kerberos',
        storage = 34123,
        playerPosition = Position(32048, 32581, 15),
        bossPosition = Position(32032, 32565, 15),
        centerPosition = Position(32041, 32569, 15),
        rangeX = 11, rangeY = 13,
        flamePosition = Position(32030, 32555, 15)
    },
    [3254] = {
        bossName = 'ethershreck',
        storage = 34124,
        playerPosition = Position(33089, 31021, 8),
        bossPosition = Position(33085, 31004, 8),
        centerPosition = Position(33088, 31012, 8),
        rangeX = 11, rangeY = 11,
        flamePosition = Position(33076, 31007, 8)
    },
    [3255] = {
        bossName = 'paiz the pauperizer',
        storage = 34125,
        playerPosition = Position(33069, 31110, 1),
        bossPosition = Position(33082, 31105, 1),
        centerPosition = Position(33076, 31110, 1),
        rangeX = 8, rangeY = 6,
        flamePosition = Position(33076, 31110, 1)
    },
    [3256] = {
        bossName = 'bretzecutioner',
        storage = 34126,
        playerPosition = Position(31973, 31184, 10),
        bossPosition = Position(31979, 31176, 10),
        centerPosition = Position(31973, 31177, 10),
        rangeX = 15, rangeY = 10,
        flamePosition = Position(31973, 31166, 10)
    },
    [3257] = {
        bossName = 'zanakeph',
        storage = 34127,
        playerPosition = Position(33077, 31040, 12),
        bossPosition = Position(33082, 31056, 12),
        centerPosition = Position(33077, 31050, 12),
        rangeX = 13, rangeY = 10,
        flamePosition = Position(33070, 31039, 12)
    },
    [3258] = {
        bossName = 'tiquandas revenge',
        storage = Storage.KillingInTheNameOf.TiquandasRevengeTeleport,
        playerPosition = Position(32888, 32580, 4),
        bossPosition = Position(32888, 32586, 4),
        centerPosition = Position(32748, 32293, 10),
        rangeX = 8, rangeY = 7,
        flamePosition = Position(33076, 31029, 11)
    },
    [3259] = {
        bossName = 'demodras',
        storage = Storage.KillingInTheNameOf.DemodrasTeleport,
        playerPosition = Position(32748, 32287, 10),
        bossPosition = Position(32747, 32294, 10),
        centerPosition = Position(32887, 32583, 4),
        rangeX = 6, rangeY = 5,
        flamePosition = Position(33076, 31029, 12)
    },
    [17521] = {
        bossName = 'necropharus',
        storage = 17521,
        playerPosition = Position(33028, 32426, 12),
        bossPosition = Position(33026, 32422, 12),
        centerPosition = Position(33028, 32424, 12),
        rangeX = 6, rangeY = 5,
        flamePosition = Position(33070, 31035, 12)
    },
    [17522] = {
        bossName = 'the horned fox',
        storage = 17522,
        playerPosition = Position(32458, 31994, 9),
        bossPosition = Position(32458, 32005, 9),
        centerPosition = Position(32450, 31400, 9),
        rangeX = 5, rangeY = 8,
        flamePosition = Position(33070, 31029, 12)
    },
    [17523] = {
        bossName = 'lethal lissy',
        storage = 17523,
        playerPosition = Position(31976, 32896, 0),
        bossPosition = Position(31983, 32897, 0),
        centerPosition = Position(31982, 32897, 0),
        rangeX = 5, rangeY = 8,
        flamePosition = Position(31987, 32896, 0)
    }
}

local boss = MoveEvent()

function boss.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local boss = bosses[item.uid] or bosses[item:getActionId()]
    if not boss then
        return true
    end

    if player:getStorageValue(boss.storage) ~= 1 or roomIsOccupied(boss.centerPosition, boss.rangeX, boss.rangeY) then
        player:teleportTo(fromPosition, true)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    player:setStorageValue(boss.storage, 0)
    player:teleportTo(boss.playerPosition)
    boss.playerPosition:sendMagicEffect(CONST_ME_TELEPORT)

    local monster = Game.createMonster(boss.bossName, boss.bossPosition)
    if not monster then
        return true
    end

    addEvent(clearBossRoom, 60 * 10 * 1000, player.uid, monster.uid, boss.centerPosition, boss.rangeX, boss.rangeY, fromPosition)
    player:say(
        "You have ten minutes to kill and loot this boss. Otherwise you will lose that chance and will be kicked out.",
        TALKTYPE_MONSTER_SAY
    )
    return true
end

boss:type("stepin")

for index, value in pairs(bosses) do
    boss:uid(index)
end

boss:uid(3260, 3261, 3262)
boss:aid(3244)
boss:register()
 

Exemplo The Old Widow

607217abc6fde_Sanstitre.thumb.png.08c042ef3fac22fe07e5e2675fec7e5a.png

Edited by lepiigor

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
lepiigor

Depois de fazer a modificação, sim funciona, por outro lado todas as tarefas grizzly são bug, 1 apenas Kill conta toda a tarefa, exemplo: Troll & Goblin BUG 1/100, apes, crocodilos, gnarlhound ... etc 1 Kill = 300 omg 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×