Ir para conteúdo
  • Cadastre-se

Scripting Problema Task System 4.0 - Vodkart


Posts Recomendados

.Qual servidor ou website você utiliza como base? 

OTX 2

Qual o motivo deste tópico? 

Estou utilizando o Task System 4.0 fornecido pelo @Vodkart, porém (randomicamente) o sistema manda caracteres inválidos pro storage, o que faz os bichos bugarem e não cairem no chão. Acontece esporadicamente com bichos aleatórios, e nunca com bichos da task daily

 

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

 

 

Você tem o código disponível? Se tiver publique-o aqui: 

 <?xml version="1.0" encoding="ISO-8859-1"?> 
<mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes"> 
<config name="task_func"><![CDATA[
task_sys = {
	[1] = {name = "Trolls", start = 176201, monsters_list = {"Troll"}, level = 8, count = 40, points = 1, items = {}, reward = {}, exp = 20000, money = 5000},
	[2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm"}, level = 12, count = 50, points = 1, items = {}, reward = {}, exp = 25000, money = 8000},
	[3] = {name = "Minotaurs", start = 176216, monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, level = 15, count = 150, points = 2, items = {}, reward = {}, exp = 30000, money = 10000},
	[4] = {name = "cyclops", start = 176203, monsters_list = {"cyclops"}, level = 19, count = 60, points = 2, items = {}, reward = {{2486,1}}, exp = 30000, money = 10000},
	[5] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 20000},
	[6] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 20000},
	[7] = {name = "Terror Birds", start = 176206, monsters_list = {"Terror Bird"}, level = 30, count = 120, points = 3, items = {}, reward = {}, exp = 100000, money = 25000},
	[8] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 4, items = {}, reward = {}, exp = 120000, money = 25000},
	[9] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 4, items = {}, reward = {}, exp = 80000, money = 25000},
	[10] = {name = "Elephants", start = 176209, monsters_list = {"elephant"}, level = 40, count = 150, points = 4, items = {}, reward = {}, exp = 120000, money = 25000},
	[11] = {name = "Dwarves", start = 176210, monsters_list = {"dwarf","dwarf soldier","dwarf guard","dwarf geomancer"}, level = 42, count = 150, points = 4, items = {}, reward = {}, exp = 200000, money = 25000},
	[12] = {name = "Vampires", start = 176211, monsters_list = {"vampire"}, level = 46, count = 170, points = 5, items = {}, reward = {}, exp = 80000, money = 30000},
	[13] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 5, items = {}, reward = {}, exp = 90000, money = 30000},
	[14] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 5, items = {}, reward = {}, exp = 200000, money = 25000},
	[15] = {name = "Bonebeasts" ,start = 176214, monsters_list = {"Bonebeast"}, level = 63, count = 250, points = 5, items = {}, reward = {}, exp = 250000, money = 25000},
	[16] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 6, items = {}, reward = {}, exp = 200000, money = 32000},
	[17] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 6, items = {}, reward = {}, exp = 30000, money = 35000},
	[18] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 7, items = {{4850,10}}, reward = {}, exp = 400000, money = 40000},
	[19] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 7, items = {{2445,1}}, reward = {}, exp = 500000, money = 45000},
	[20] = {name = "Behemoths" ,start = 176224, monsters_list = {"Behemoth"}, level = 108, count = 800, points = 8, items = {}, reward = {}, exp = 5000000, money = 200000},
	[21] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 6666, points = 20, items = {}, reward = {{2495,1}}, exp = 6660000, money = 500000},
	[22] = {name = "Orshabaals" ,start = 176226, monsters_list = {"Orshabaal"}, level = 120, count = 300, points = 10, items = {}, reward = {{2341,1},{5114,1}}, exp = 9960000, money = 800000},
	[23] = {name = "Ferumbras" ,start = 176227, monsters_list = {"Ferumbras"}, level = 130, count = 50, points = 10, items = {}, reward = {{5161,1}}, exp = 6660000, money = 666000},
	[24] = {name = "Golden Knights" ,start = 176228, monsters_list = {"Golden Knight"}, level = 200, count = 10, points = 10, items = {}, reward = {{2646,1}}, exp = 10660000, money = 900000},
	[25] = {name = "Cacheros" ,start = 176229, monsters_list = {"Cachero"}, level = 200, count = 200, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
	[26] = {name = "Eternal Oblivions" ,start = 176230, monsters_list = {"Eternal Oblivion"}, level = 200, count = 200, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
	[27] = {name = "Infernus" ,start = 176231, monsters_list = {"Infernus"}, level = 200, count = 300, points = 15, items = {}, reward = {{5149,3}}, exp = 10000000, money = 300000}
}
daily_task = {
	[1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord", "Orc", "Orc Spearman", "Orc Warrior"}, count = 100, points = 2, reward = {}, exp = 50000, money = 10000},
	[2] = {name = "Rotworms" ,monsters_list = {"Rotworm"}, count = 220, points = 2, reward = {}, exp = 90000, money = 12000},
	[3] = {name = "Cyclops" ,monsters_list = {"Cyclops"}, count = 165, points = 3, reward = {}, exp = 9000, money = 15000},
	[4] = {name = "Minotaurs" ,monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, count = 185, points = 3, reward = {}, exp = 90000, money = 15000},
	[5] = {name = "Ghouls" ,monsters_list = {"Ghoul"}, count = 150, points = 3, reward = {}, exp = 90000, money = 11000},
	[6] = {name = "Dragons" ,monsters_list = {"Dragon"}, count = 150, points = 3, reward = {}, exp = 20000, money = 10000},
	[7] = {name = "Vampires" ,monsters_list = {"Vampire"}, count = 200, points = 3, reward = {}, exp = 200000, money = 25000},
	[8] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 220000, money = 18000},
	[9] = {name = "Behemoths" ,monsters_list = {"Behemoth"}, count = 300, points = 5, reward = {}, exp = 500000, money = 60000},
	[10] = {name = "Heroes" ,monsters_list = {"Hero"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
	[11] = {name = "Black Knights" ,monsters_list = {"Black Knight"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
	[12] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 5, reward = {}, exp = 60000, money = 70000},
	[13] = {name = "Warlocks" ,monsters_list = {"Warlock"}, count = 700, points = 5, reward = {{2173,1}}, exp = 90000, money = 120000},
	[14] = {name = "Hydras" ,monsters_list = {"Hydra"}, count = 700, points = 5, reward = {}, exp = 100000, money = 160000},
	[15] = {name = "Dragon Lords" ,monsters_list = {"Dragon Lord"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
	[16] = {name = "Frost Dragons" ,monsters_list = {"Frost Dragon"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
	[17] = {name = "Serpent Spawns" ,monsters_list = {"Serpent Spawn"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
	[18] = {name = "Juggernauts" ,monsters_list = {"Juggernaut"}, count = 600, points = 5, reward = {{5156,1}}, exp = 1000000, money = 200000},
	[19] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 600, points = 8, reward = {{5154,1}}, exp = 1000000, money = 200000},
	[20] = {name = "Hellhounds" ,monsters_list = {"Hellhound"}, count = 600, points = 8, reward = {{5159,1}}, exp = 1000000, money = 200000},
	[21] = {name = "Cacheros" ,monsters_list = {"Cachero"}, count = 600, points = 10, reward = {}, exp = 10000000, money = 300000}
	
}
task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
function getTaskMission(cid)
	return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
end
function getDailyTaskMission(cid)
	return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
end
function getTaskPoints(cid)
	return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
end
function doRandomDailyTask(cid)
	local t = {
		[{6,80}] = {1,5},
		[{81,149}] = {6,12},
		[{150,250}] = {13,17},
		[{251,math.huge}] = {18,21}
	}
	for a , b in pairs(t) do
		if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
			return math.random(b[1], b[2])
		end
	end
	return 0
end
function GetRankTask(cid)
	local ranks = {
		[{1, 20}] = "Huntsman", 
		[{21, 50}] = "Ranger",
		[{51, 100}] = "Big Game Hunter",
		[{101, 200}] = "Senior Hunter",		
		[{201, math.huge}] = "Extreme Hunter"
	}
	for v , r in pairs(ranks) do
		if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
			return r
		end
	end
	return 0
end
function getItemsFromList(items)
	local str = ''
	if table.maxn(items) > 0 then
		for i = 1, table.maxn(items) do
			str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1])
			if i ~= table.maxn(items) then str = str .. ', ' 
			end 
		end 
	end
	return str
end
function doRemoveItemsFromList(cid,items)
	local count = 0
	if table.maxn(items) > 0 then
		for i = 1, table.maxn(items) do
			if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
			count = count + 1 end 
		end 
	end
	if count == table.maxn(items) then
		for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
	else 
		return false 
	end
	return true 
end
function getMonsterFromList(monster)
	local str = ''
	if #monster > 0 then
		for i = 1, #monster do
			str = str .. monster[i]
			if i ~= #monster then str = str .. ', ' end
		end 
	end
	return str
end
function GiveRewardsTask(cid, items)
	local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID
	for _, i_i in ipairs(items) do
		local item, amount = i_i[1],i_i[2]
		if isItemStackable(item) or amount == 1 then
			doAddContainerItem(backpack, item, amount)
		else
			for i = 1, amount do
				doAddContainerItem(backpack, item, 1)
			end
		end
	end
end
function isSummon(cid)
	if(not isCreature(cid)) then
		return false
	end
	return getCreatureMaster(cid) ~= cid
end
]]></config>
<event type="login" name="TaskLogin" event="script"><![CDATA[
function onLogin(cid)
	registerCreatureEvent(cid, "KillTask")
	registerCreatureEvent(cid, "TaskLook")
	return true
end]]></event>
<talkaction words="/task;!task" event="buffer"><![CDATA[
domodlib('task_func')
param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
if isInArray({"counter","contador"},param) then
	setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] The counter was "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "enabled" or "disabled")..".") return true
elseif isInArray({"daily","diaria"},param) then
	if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
		doPlayerSendCancel(cid, "Sorry, but you are not on any Task Daily.") return true
	elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
		doPlayerSendCancel(cid,"Sorry, you didn't finish the Daily Task in time! Please go back to NPC Task and start a new Daily Task.") return true
	end
	return doShowTextDialog(cid, 1961, "[->] CURRENT DAILY TASK INFO [<-]\n\nName: "..daily_task[daily].name.."\nProgress: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nDelivery time: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonsters to hunt: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperience: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "None")..".")
end
if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
	doPlayerSendCancel(cid, "You are not on any task.") return true
end 
return doShowTextDialog(cid, 1961, "-> TASK POINTS [" .. getTaskPoints(cid).. "] <- \n\n-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "None")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..(task_sys[task].money > 0 and task_sys[task].money or 0).."\nReward Experience: "..(task_sys[task].exp > 0 and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nReward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "None")..".")
]]></talkaction>
<event type="look" name="TaskLook" event="script"><![CDATA[
domodlib('task_func')
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
		doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
	end	
	return true
end]]></event> 
<event type="kill" name="KillTask" event="script"><![CDATA[
domodlib('task_func')
function onKill(cid, target)
	if isPlayer(cid) and isMonster(target) then
		local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]
		if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
			setPlayerStorageValue(cid, task_sys_storages[3], getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[3])+1))
			if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[3]) < t.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] You defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[3]) .. "/" .. t.count .. "] of the Task of the " .. t.name .. ".")
			end
			if getPlayerStorageValue(cid, task_sys_storages[3]) >= t.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Congratulations! You have finished the Task of "..t.name..", go back to NPC to get your reward.")
			end
		end
		if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
			setPlayerStorageValue(cid, task_sys_storages[5], getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 1 or (getPlayerStorageValue(cid, task_sys_storages[5])+1))
			if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] You defeated Total [" .. getPlayerStorageValue(cid, task_sys_storages[5]) .. "/" .. daily.count .. "] of the Task of the " .. daily.name .. ".")
			end
			if getPlayerStorageValue(cid, task_sys_storages[5]) >= daily.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Congratulations! You have finished the Task of "..daily.name..", go back to NPC to get your reward.")
			end
		end
		return true
	end
	return true
end]]></event>
</mod>

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. 

1629121910006.png1629121779284.png

Link para o post
Compartilhar em outros sites
  • 2 months later...

Meu mod está resetando as tasks no meio dela, tá estranho.

image.thumb.png.12a7d5e9b48452e7e4883942be04aa2c.png

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod name="Simple Task" version="4.0" author="Vodkart" contact="tibiaking.com" enabled="yes">
<config name="task_func"><![CDATA[
task_sys = {
    [1] = {name = "Trolls", start = 176201, monsters_list = {"Troll"}, level = 8, count = 40, points = 1, items = {}, reward = {}, exp = 20000, money = 2000},
    [2] = {name = "rotworms", start = 176202, monsters_list = {"rotworm"}, level = 12, count = 50, points = 1, items = {}, reward = {}, exp = 25000, money = 3000},
    [3] = {name = "Minotaurs", start = 176216, monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, level = 15, count = 150, points = 2, items = {}, reward = {}, exp = 30000, money = 10000},
    [4] = {name = "cyclops", start = 176203, monsters_list = {"cyclops"}, level = 19, count = 60, points = 2, items = {}, reward = {{2486,1}}, exp = 30000, money = 3000},
    [5] = {name = "Dwarves", start = 176210, monsters_list = {"dwarf","dwarf soldier","dwarf guard","dwarf geomancer"}, level = 42, count = 150, points = 4, items = {}, reward = {}, exp = 200000, money = 15000},
    [6] = {name = "Terror Birds", start = 176206, monsters_list = {"Terror Bird"}, level = 30, count = 120, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
    [7] = {name = "Stone Golems", start = 176207, monsters_list = {"Stone Golem"}, level = 33, count = 130, points = 4, items = {}, reward = {}, exp = 120000, money = 7000},
    [8] = {name = "Carniphilas", start = 176208, monsters_list = {"carniphila"}, level = 36, count = 135, points = 4, items = {}, reward = {}, exp = 80000, money = 8000},
    [9] = {name = "Elephants", start = 176209, monsters_list = {"elephant"}, level = 40, count = 150, points = 4, items = {}, reward = {}, exp = 120000, money = 8200},
    [10] = {name = "Green Djinn", start = 176204, monsters_list = {"Green Djinn","Efreet"}, level = 23, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
    [11] = {name = "Blue Djinn", start = 176205, monsters_list = {"Blue Djinn","Marid"}, level = 25, count = 80, points = 3, items = {}, reward = {}, exp = 100000, money = 5000},
    [12] = {name = "Necromancer" ,start = 176213, monsters_list = {"Necromancer"}, level = 60, count = 200, points = 5, items = {}, reward = {}, exp = 200000, money = 15000},
    [13] = {name = "Bonebeasts" ,start = 176214, monsters_list = {"Bonebeast"}, level = 63, count = 250, points = 5, items = {}, reward = {}, exp = 250000, money = 11000},
    [14] = {name = "Vampires", start = 176211, monsters_list = {"vampire"}, level = 46, count = 170, points = 5, items = {}, reward = {}, exp = 80000, money = 8500},
    [15] = {name = "Dragons", start = 176212, monsters_list = {"dragon"}, level = 50, count = 120, points = 5, items = {}, reward = {}, exp = 90000, money = 9000},
    [16] = {name = "Heroes", start = 176240, monsters_list = {"Hero"}, level = 50, count = 320, points = 7, items = {}, reward = {}, exp = 200000, money = 30000},
    [17] = {name = "Giant Spider" ,start = 176215, monsters_list = {"Giant Spider","The old widow"}, level = 80, count = 500, points = 6, items = {}, reward = {}, exp = 200000, money = 32000},
    [18] = {name = "Hellspawn" ,start = 176232, monsters_list = {"Hellspawn"}, level = 80, count = 500, points = 7, items = {}, reward = {}, exp = 300000, money = 52000},
    [19] = {name = "Dragon Lords" ,start = 176219, monsters_list = {"Dragon lord"}, level = 88, count = 650, points = 6, items = {}, reward = {}, exp = 35000, money = 35000},
    [20] = {name = "Hydras" ,start = 176222, monsters_list = {"Hydra"}, level = 100, count = 700, points = 7, items = {{4850,10}}, reward = {}, exp = 400000, money = 40000},
    [21] = {name = "Serpent Spawn" ,start = 176223, monsters_list = {"Serpent Spawn"}, level = 103, count = 720, points = 7, items = {{2445,1}}, reward = {}, exp = 500000, money = 45000},
    [22] = {name = "Behemoths" ,start = 176224, monsters_list = {"Behemoth"}, level = 108, count = 800, points = 8, items = {}, reward = {}, exp = 5000000, money = 200000},
    [23] = {name = "Demons" ,start = 176225, monsters_list = {"Demon"}, level = 110, count = 6666, points = 20, items = {}, reward = {{2495,1}}, exp = 6660000, money = 500000},
    [24] = {name = "Ashmunrah" ,start = 176233, monsters_list = {"Ashmunrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [25] = {name = "Rahemos" ,start = 176234, monsters_list = {"Rahemos"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [26] = {name = "Thalas" ,start = 176235, monsters_list = {"Thalas"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [27] = {name = "Dipthrah" ,start = 176236, monsters_list = {"Dipthrah"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [28] = {name = "Mahrdis" ,start = 176237, monsters_list = {"Mahrdis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [29] = {name = "Omruc" ,start = 176238, monsters_list = {"Omruc"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [30] = {name = "Morguthis" ,start = 176239, monsters_list = {"Morguthis"}, level = 110, count = 500, points = 20, items = {}, reward = {}, exp = 1500000, money = 200000},
    [31] = {name = "Orshabaals" ,start = 176226, monsters_list = {"Orshabaal"}, level = 120, count = 300, points = 10, items = {}, reward = {{2341,1},{5114,1}}, exp = 9960000, money = 800000},
    [32] = {name = "Ferumbras" ,start = 176227, monsters_list = {"Ferumbras"}, level = 130, count = 100, points = 10, items = {}, reward = {{5161,1}}, exp = 6660000, money = 666000},
    [33] = {name = "Golden Knights" ,start = 176228, monsters_list = {"Golden Knight"}, level = 200, count = 100, points = 10, items = {}, reward = {{2646,1}}, exp = 10660000, money = 900000},
    [34] = {name = "Cacheros" ,start = 176229, monsters_list = {"Cachero"}, level = 200, count = 500, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
    [35] = {name = "Eternal Oblivions" ,start = 176230, monsters_list = {"Eternal Oblivion"}, level = 500, count = 200, points = 10, items = {}, reward = {{2646,1}}, exp = 10000000, money = 300000},
    [36] = {name = "Infernus" ,start = 176231, monsters_list = {"Infernus"}, level = 200, count = 300, points = 15, items = {}, reward = {{5149,3}}, exp = 10000000, money = 300000}
}
daily_task = {
    [1] = {name = "Orcs" ,monsters_list = {"Orc Berserker","Orc Rider","Orc Leader","Orc Warlord", "Orc", "Orc Spearman", "Orc Warrior"}, count = 100, points = 2, reward = {}, exp = 50000, money = 10000},
    [2] = {name = "Rotworms" ,monsters_list = {"Rotworm"}, count = 220, points = 2, reward = {}, exp = 90000, money = 12000},
    [3] = {name = "Cyclops" ,monsters_list = {"Cyclops"}, count = 165, points = 3, reward = {}, exp = 9000, money = 15000},
    [4] = {name = "Minotaurs" ,monsters_list = {"minotaur","minotaur guard","minotaur archer","minotaur mage"}, count = 185, points = 3, reward = {}, exp = 90000, money = 15000},
    [5] = {name = "Ghouls" ,monsters_list = {"Ghoul"}, count = 150, points = 3, reward = {}, exp = 90000, money = 11000},
    [6] = {name = "Dragons" ,monsters_list = {"Dragon"}, count = 150, points = 3, reward = {}, exp = 20000, money = 10000},
    [7] = {name = "Vampires" ,monsters_list = {"Vampire"}, count = 200, points = 3, reward = {}, exp = 200000, money = 25000},
    [8] = {name = "Ancient Scarabs" ,monsters_list = {"Ancient Scarab"}, count = 180, points = 5, reward = {}, exp = 220000, money = 18000},
    [9] = {name = "Behemoths" ,monsters_list = {"Behemoth"}, count = 300, points = 5, reward = {}, exp = 500000, money = 60000},
    [10] = {name = "Heroes" ,monsters_list = {"Hero"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
    [11] = {name = "Black Knights" ,monsters_list = {"Black Knight"}, count = 260, points = 5, reward = {}, exp = 400000, money = 55000},
    [12] = {name = "Giant Spiders" ,monsters_list = {"Giant Spider"}, count = 350, points = 5, reward = {}, exp = 60000, money = 70000},
    [13] = {name = "Warlocks" ,monsters_list = {"Warlock"}, count = 700, points = 5, reward = {{2173,1}}, exp = 90000, money = 120000},
    [14] = {name = "Hydras" ,monsters_list = {"Hydra"}, count = 700, points = 5, reward = {}, exp = 100000, money = 160000},
    [15] = {name = "Dragon Lords" ,monsters_list = {"Dragon Lord"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
    [16] = {name = "Frost Dragons" ,monsters_list = {"Frost Dragon"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
    [17] = {name = "Serpent Spawns" ,monsters_list = {"Serpent Spawn"}, count = 400, points = 5, reward = {{2445,1}}, exp = 1300000, money = 200000},
    [18] = {name = "Juggernauts" ,monsters_list = {"Juggernaut"}, count = 600, points = 5, reward = {{5156,1}}, exp = 1000000, money = 200000},
    [19] = {name = "Undead Dragons" ,monsters_list = {"Undead Dragon"}, count = 600, points = 8, reward = {{5154,1}}, exp = 1000000, money = 200000},
    [20] = {name = "Hellhounds" ,monsters_list = {"Hellhound"}, count = 600, points = 8, reward = {{5159,1}}, exp = 1000000, money = 200000},
    [21] = {name = "Cacheros" ,monsters_list = {"Cachero"}, count = 600, points = 10, reward = {}, exp = 10000000, money = 300000}
 
}
task_sys_storages = {176601, 176602, 176603, 176604, 176605, 176606, 176607, 176608} -- task, points, count, daily task, daily count, daily time , daily start, contador
function getTaskMission(cid)
    return getPlayerStorageValue(cid,task_sys_storages[1]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[1])
end
function getDailyTaskMission(cid)
    return getPlayerStorageValue(cid,task_sys_storages[4]) < 0 and 1 or getPlayerStorageValue(cid,task_sys_storages[4])
end
function getTaskPoints(cid)
    return getPlayerStorageValue(cid,task_sys_storages[2]) < 0 and 0 or getPlayerStorageValue(cid,task_sys_storages[2])
end
function doRandomDailyTask(cid)
    local t = {
        [{6,80}] = {1,5},
        [{81,149}] = {6,12},
        [{150,250}] = {13,17},
        [{251,math.huge}] = {18,21}
    }
    for a , b in pairs(t) do
        if getPlayerLevel(cid) >= a[1] and getPlayerLevel(cid) <= a[2] then
            return math.random(b[1], b[2])
        end
    end
    return 0
end
function GetRankTask(cid)
    local ranks = {
        [{1, 20}] = "Huntsman",
        [{21, 50}] = "Ranger",
        [{51, 100}] = "Big Game Hunter",
        [{101, 200}] = "Senior Hunter",       
        [{201, math.huge}] = "Extreme Hunter"
    }
    for v , r in pairs(ranks) do
        if getTaskPoints(cid) >= v[1] and getTaskPoints(cid) <= v[2] then
            return r
        end
    end
    return 0
end
function getItemsFromList(items)
    local str = ''
    if table.maxn(items) > 0 then
        for i = 1, table.maxn(items) do
            str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1])
            if i ~= table.maxn(items) then str = str .. ', '
            end
        end
    end
    return str
end
function doRemoveItemsFromList(cid,items)
    local count = 0
    if table.maxn(items) > 0 then
        for i = 1, table.maxn(items) do
            if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then
            count = count + 1 end
        end
    end
    if count == table.maxn(items) then
        for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end
    else
        return false
    end
    return true
end
function getMonsterFromList(monster)
    local str = ''
    if #monster > 0 then
        for i = 1, #monster do
            str = str .. monster[i]
            if i ~= #monster then str = str .. ', ' end
        end
    end
    return str
end
function GiveRewardsTask(cid, items)
    local backpack = doPlayerAddItem(cid, 1999, 1) -- backpackID
    for _, i_i in ipairs(items) do
        local item, amount = i_i[1],i_i[2]
        if isItemStackable(item) or amount == 1 then
            doAddContainerItem(backpack, item, amount)
        else
            for i = 1, amount do
                doAddContainerItem(backpack, item, 1)
            end
        end
    end
end
function isSummon(cid)
    if(not isCreature(cid)) then
        return false
    end
    return getCreatureMaster(cid) ~= cid
end
]]></config>
<event type="login" name="TaskLogin" event="script"><![CDATA[
function onLogin(cid)
    registerCreatureEvent(cid, "KillTask")
    registerCreatureEvent(cid, "TaskLook")
    return true
end]]></event>
<talkaction words="/task;!task" event="buffer"><![CDATA[
domodlib('task_func')
param,task,daily = param:lower(), getTaskMission(cid), getDailyTaskMission(cid)
if isInArray({"counter","contador"},param) then
    setPlayerStorageValue(cid, task_sys_storages[8], getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and 1 or 0)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Task System] The counter was "..(getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and "enabled" or "disabled")..".") return true
elseif isInArray({"daily","diaria"},param) then
    if not daily_task[daily] or getPlayerStorageValue(cid, task_sys_storages[7]) <= 0 then
        doPlayerSendCancel(cid, "Sorry, but you are not on any Task Daily.") return true
    elseif getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() <= 0 and getPlayerStorageValue(cid, task_sys_storages[5]) < daily_task[daily].count then
        doPlayerSendCancel(cid,"Sorry, you didn't finish the Daily Task in time! Please go back to NPC Task and start a new Daily Task.") return true
    end
    return doShowTextDialog(cid, 1961, "[->] CURRENT DAILY TASK INFO [<-]\n\nName: "..daily_task[daily].name.."\nProgress: ["..(getPlayerStorageValue(cid, task_sys_storages[5]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[5])).."/"..daily_task[daily].count.."]\nDelivery time: "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,task_sys_storages[6])).."\nMonsters to hunt: "..getMonsterFromList(daily_task[daily].monsters_list).."\n\n[->] CURRENT TASK REWARDS [<-]\n\nMoney: "..(daily_task[daily].money > 0 and daily_task[daily].money or 0).."\nExperience: "..(daily_task[daily].exp > 0 and daily_task[daily].exp or 0).."\nTask Points: "..daily_task[daily].points.."\nItems: "..(#daily_task[daily].reward > 0 and getItemsFromList(daily_task[daily].reward) or "None")..".")
end
if not task_sys[task] or getPlayerStorageValue(cid, task_sys[task].start) <= 0 then
    doPlayerSendCancel(cid, "You are not on any task.") return true
end
return doShowTextDialog(cid, 1961, "-> TASK POINTS [" .. getTaskPoints(cid).. "] <- \n\n-> CURRENT TASK ["..getTaskMission(cid).."/"..#task_sys.."] <-\n\nTask Name: "..task_sys[task].name.."\nTask Level: "..task_sys[task].level.."\nTask Progress: ["..(getPlayerStorageValue(cid, task_sys_storages[3]) < 0 and 0 or getPlayerStorageValue(cid, task_sys_storages[3])).."/"..task_sys[task].count.."]\nMonster To Hunt: "..getMonsterFromList(task_sys[task].monsters_list)..".\nItens Para Entrega: "..(#task_sys[task].items > 0 and getItemsFromList(task_sys[task].items) or "None")..".\n\n[->] CURRENT TASK REWARDS [<-]\n\nReward Money: "..((tonumber(task_sys[task].money) and tonumber(task_sys[task].money) > 0) and task_sys[task].money or 0).."\nReward Experience: "..((tonumber(task_sys[task].exp) and tonumber(task_sys[task].exp) > 0) and task_sys[task].exp or 0).."\nReward Points: "..task_sys[task].points.."\nReward Items: "..(#task_sys[task].reward > 0 and getItemsFromList(task_sys[task].reward) or "None")..".")
]]></talkaction>
<event type="look" name="TaskLook" event="script"><![CDATA[
domodlib('task_func')
function onLook(cid, thing, position, lookDistance)
    if isPlayer(thing.uid) and getTaskPoints(thing.uid) > 0 then
        doPlayerSetSpecialDescription(thing.uid, "\n"..(getPlayerSex(thing.uid) == 0 and "She" or "He").. " is a "..GetRankTask(thing.uid))
    end   
    return true
end]]></event>
<event type="kill" name="KillTask" event="script"><![CDATA[
domodlib('task_func')
function onKill(cid, target)
    if isPlayer(cid) and isMonster(target) then
        local t,daily = task_sys[getTaskMission(cid)], daily_task[getDailyTaskMission(cid)]       
        if t and getPlayerStorageValue(cid, t.start) > 0 and isInArray(t.monsters_list, getCreatureName(target):lower())then
            local ab = getPlayerStorageValue(cid, task_sys_storages[3]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[3]))
            if tonumber(ab) and tonumber(ab) < t.count then
                setPlayerStorageValue(cid, task_sys_storages[3], ab <= 0 and tonumber(1) or tonumber(ab+1))
                if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) and tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) < t.count then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) .. "/" .. t.count .. "] of the Task of the " .. t.name .. ".")
                end
                if tonumber(getPlayerStorageValue(cid, task_sys_storages[3])) >= t.count then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Task System] Congratulations! You have finished the Task of "..t.name..", go back to NPC to get your reward.")
                end
            end
        end
        if daily and getPlayerStorageValue(cid, task_sys_storages[7]) > 0 and getPlayerStorageValue(cid, task_sys_storages[6]) - os.time() >= 0 and isInArray(daily.monsters_list, getCreatureName(target):lower()) then
            local cd = getPlayerStorageValue(cid, task_sys_storages[5]) == -1 and tonumber(0) or tonumber(getPlayerStorageValue(cid, task_sys_storages[5]))
            if tonumber(cd) and cd < daily.count then
                setPlayerStorageValue(cid, task_sys_storages[5], cd <= 0 and tonumber(1) or tonumber(cd+1))
                if getPlayerStorageValue(cid, task_sys_storages[8]) <= 0 and tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) < daily.count then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"[Daily Task System] You defeated Total [" .. tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) .. "/" .. daily.count .. "] of the Task of the " .. daily.name .. ".")
                end
                if tonumber(getPlayerStorageValue(cid, task_sys_storages[5])) >= daily.count then
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"[Daily Task System] Congratulations! You have finished the Task of "..daily.name..", go back to NPC to get your reward.")
                end
            end
        end
        return true
    end
    return true
end]]></event>
</mod>

 

Link para o post
Compartilhar em outros sites
  • 3 weeks later...

tenho que refazer o sistema de task para o 5.0 eu já dei inicio só falta terminar, vou criar uma coluna própria dentro do banco de dados para o armazenamento das tasks, que só aceitem números, pq storage aceita números e caracteres, ai em alguns server buga tudo... obrigado, aguardem!

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
5 minutos atrás, Vodkart disse:

tenho que refazer o sistema de task para o 5.0 eu já dei inicio só falta terminar, vou criar uma coluna própria dentro do banco de dados para o armazenamento das tasks, que só aceitem números, pq storage aceita números e caracteres, ai em alguns server buga tudo... obrigado, aguardem!

@Vodkartalguma chance de mexer no autoloot system pra OTX?  Aquela parada de consultar o loot em arquivo TXT pode dar uma pesada com muita gente, tem alguns bugs tb

Link para o post
Compartilhar em outros sites
11 minutos atrás, Bruno Rezende disse:

@Vodkartalguma chance de mexer no autoloot system pra OTX?  Aquela parada de consultar o loot em arquivo TXT pode dar uma pesada com muita gente, tem alguns bugs tb

 

arquivo txt não pesa nada, não chega a 1kb por pessoa, se fosse assim o logs que fica salvo tudo nem daria para fazer... mas é bom ter mais que 2 versões, eu vou colocar a versão por db e a versão por txt...

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
2 minutos atrás, Vodkart disse:

 

arquivo txt não pesa nada, não chega a 1kb por pessoa, se fosse assim o logs que fica salvo tudo nem daria para fazer... mas é bom ter mais que 2 versões, eu vou colocar a versão por db e a versão por txt...

O "peso" eu falo por muitas pessoas consultarem simultaneamente um arquivo externo no disco, não o tamanho em si. O erro te mandei acima.

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) scriptstream << *m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
    • Por Muvuka
      Abri canal a força creaturescript acho que funcione no creaturescript cria script creaturescript
       
      <channel id="9" name="HELP" logged="yes"/>
      <channel id="12" name="Report Bugs" logged="yes"/>
      <channel id="13" name="Loot" logged="yes"/>
      <channel id="14" name="Report Character Rules Tibia Rules" logged="yes"/>
      <channel id="15" name="Death Channel"/>
      <channel id="6548" name="DexSoft" level="1"/>
      <channel id="7" name="Reports" logged="yes"/>
       
      antes de 
              if(lastLogin > 0) then adicione isso:
                      doPlayerOpenChannel(cid, CHANNEL_HELP) doPlayerOpenChannel(cid, 1,  2, 3) = 1,2 ,3 Channels, entendeu? NÃO FUNCIONA EU QUERO UM MEIO DE ABRI SEM USA A SOURCE
       
      EU NÃO CONSEGUI ABRI EU NÃO TENHO SOURCE
       
       
    • Por bolachapancao
      Rapaziada seguinte preciso de um script que ao utilizar uma alavanca para até 4 jogadores.
      Os jogadores serão teleportados para hunt durante uma hora e depois de uma hora os jogadores serão teleportados de volta para o templo.
       
      Observação: caso o jogador morra ou saia da hunt o evento hunt é cancelado.

      Estou a base canary
      GitHub - opentibiabr/canary: Canary Server 13.x for OpenTibia community.
       
    • Por RAJADAO
      .Qual servidor ou website você utiliza como base? 
      Sabrehaven 8.0
      Qual o motivo deste tópico? 
      Ajuda com novos efeitos
       
      Olá amigos, gostaria de ajuda para introduzir os seguintes efeitos no meu servidor (usando o Sabrehaven 8.0 como base), adicionei algumas runas novas (avalanche, icicle, míssil sagrado, stoneshower & Thunderstorm) e alguns novos feitiços (exevo mas san, exori san, exori tera, exori frigo, exevo gran mas frigo, exevo gran mas tera, exevo tera hur, exevo frigo hur) mas nenhum dos efeitos dessas magias parece existir no servidor, alguém tem um link para um tutorial ou algo assim para que eu possa fazer isso funcionar?
      Desculpe pelo mau inglês, sou brasileiro.

      Obrigado!


      AVALANCHE RUNE id:3161 \/
      (COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

      STONESHOWER RUNE id:3175 \/
      (COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_STONES)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)

      THUNDERSTORM RUNE id:3202 \/
      (COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_E NERGYHIT)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)

      ICICLE RUNE id:3158 \/
      COMBAT_ICEDAMAGE
      CONST_ME_ICEAREA
      CONST_ANI_ICE

      SANTO MÍSSIL RUNA id:3182 \/
      (COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

      CONST_ME_PLANTATTACK (exevo gran mas tera)
      CONST_ME_ICETORNADO (exevo gran mas frigo)
      CONST_ME_SMALLPLANTS (exevo tera hur)
      CONST_ME_ICEAREA (exevo frigo hur)
      CONST_ME_ICEATTACK (exori frigo)
      CONST_ME_CARNIPHILA (exori tera)

      EXORI SAN \/
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
      CONST_ME_HOLYDAM IDADE

      EXEVO MAS SAN \/
      CONST_ME_HOLYAREA
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo