mirror of
https://github.com/EQMacEmu/quests
synced 2026-08-21 00:23:04 -04:00
upload quests
This commit is contained in:
parent
d5cd15c9a5
commit
df860b6eb9
5339 changed files with 174551 additions and 0 deletions
41
lua_modules/general_ext.lua
Normal file
41
lua_modules/general_ext.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
function eq.ChooseRandom(...)
|
||||
local tbl = {...};
|
||||
return tbl[math.random(#tbl)];
|
||||
end
|
||||
|
||||
function eq.SelfCast(spell_id)
|
||||
local init = eq.get_initiator();
|
||||
local sp = Spell(spell_id);
|
||||
|
||||
if(init.null or sp.null) then
|
||||
return;
|
||||
end
|
||||
|
||||
init:SpellFinished(spell_id, init, 10, 0, -1, sp:ResistDiff());
|
||||
end
|
||||
|
||||
function eq.ClassType(class)
|
||||
if(class == 8 or class == 15 or class == 3 or class == 4 or class == 5) then
|
||||
return "hybrid";
|
||||
elseif(class == 1 or class == 7 or class == 16 or class == 9) then
|
||||
return "melee";
|
||||
elseif(class == 11 or class == 12 or class == 13 or class == 14) then
|
||||
return "caster"
|
||||
elseif(class == 2 or class == 10 or class == 6) then
|
||||
return "priest";
|
||||
end
|
||||
|
||||
return "other";
|
||||
end
|
||||
|
||||
-- random amount of cash in copper, returns totals of copper, silver, gold, platinum
|
||||
function eq.RandomCash(min, max)
|
||||
local total = math.random(min, max)
|
||||
local platinum = math.modf(total / 1000)
|
||||
total = total - platinum * 1000
|
||||
local gold = math.modf(total / 100)
|
||||
total = total - gold * 100
|
||||
local silver = math.modf(total / 10)
|
||||
total = total - silver * 10
|
||||
return total, silver, gold, platinum
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue