#301 loot_global needs a lua_script to access the ZoneScript and call function loot_criteria(Spawn)

已關閉
image3 年之前創建 · 2 條評論

We need the ability to return true/false in a function loot_criteria in the ZoneScript. This would allow us to set more specific criteria than the database allows (in this case zone id, min and max level)

May also want to investigate into supporting Level/Racial type in the loot_global table in their own way (whether ZoneScript or a different type of lua script)

We need the ability to return true/false in a function loot_criteria in the ZoneScript. This would allow us to set more specific criteria than the database allows (in this case zone id, min and max level) May also want to investigate into supporting Level/Racial type in the loot_global table in their own way (whether ZoneScript or a different type of lua script)
image 評論 3 年之前'
協同者
loot_criteria_zone(Zone, Spawn, LootTableID, MinLevel, MaxLevel)
loot_criteria_racial(Zone, Spawn, LootTableID, MinLevel, MaxLevel)
loot_criteria_level(Zone, Spawn, LootTableID, MinLevel, MaxLevel)
  • Spawn: the target of the loot table to be added
  • LootTableID: the current loot table id we are checking to add to the Spawn
  • MinLevel/MaxLevel: Criteria from the global loot table that is handled via code (eg. always add if minlevel/maxlevel is 0, otherwise it is based on the Spawn's level)

  • return value of 0 will skip the provided LootTableID(int32) despite the database MinLevel/MaxLevel checks

  • return value of 1 will always include the loot table id on the Spawn list, even overriding if the min/max level check fails in the code

``` loot_criteria_zone(Zone, Spawn, LootTableID, MinLevel, MaxLevel) loot_criteria_racial(Zone, Spawn, LootTableID, MinLevel, MaxLevel) loot_criteria_level(Zone, Spawn, LootTableID, MinLevel, MaxLevel) ``` - Spawn: the target of the loot table to be added - LootTableID: the current loot table id we are checking to add to the Spawn - MinLevel/MaxLevel: Criteria from the global loot table that is handled via code (eg. always add if minlevel/maxlevel is 0, otherwise it is based on the Spawn's level) - return value of 0 will skip the provided LootTableID(int32) despite the database MinLevel/MaxLevel checks - return value of 1 will __always__ include the loot table id on the Spawn list, even overriding if the min/max level check fails in the code
image 評論 3 年之前'
協同者

Adding this to ZoneScripts/QueensColony.lua omits all crabs from the queens colony trash list (loot table id 100)

function loot_criteria_zone(Zone, Spawn, LootTableID, MinLevel, MaxLevel)
	name = GetName(Spawn)
	if LootTableID == 100 and string.match(name, ".*crab.*") then
		return 0;
	end
	
	return 1;
end

you can use /loot list to confirm, must /reload zonescripts to get the QueensColony.lua to reload. Lastly you need to /repop the zone or let the Spawn respawn to properly populate the loot list.

Adding this to ZoneScripts/QueensColony.lua omits all crabs from the queens colony trash list (loot table id 100) ``` function loot_criteria_zone(Zone, Spawn, LootTableID, MinLevel, MaxLevel) name = GetName(Spawn) if LootTableID == 100 and string.match(name, ".*crab.*") then return 0; end return 1; end ``` you can use /loot list to confirm, must /reload zonescripts to get the QueensColony.lua to reload. Lastly you need to /repop the zone or let the Spawn respawn to properly populate the loot list.
image3 年之前 關閉
登入 才能加入這對話。
正在加載...
取消
保存
尚未有任何內容