Page 1 of 1
reqbuffname on skill to have 2 buffs?
Posted: Mon Jul 27, 2015 2:30 pm
by noobbotter
Can a skill have 2 required buffs, as in "don't use the skill unless both buffs are present"?
If so, would you implement that like:
Re: reqbuffname on skill to have 2 buffs?
Posted: Mon Jul 27, 2015 3:24 pm
by BlubBlab
I'm not sure but I will take a look because next todo to add something similar to the skills for my framework but I suspect it works because I saw something similar elsewhere
Re: reqbuffname on skill to have 2 buffs?
Posted: Mon Jul 27, 2015 3:57 pm
by BlubBlab
No it can't is the answer
For that it needs somewhere something like this:
Code: Select all
if( randomfollow ) then
local t = {}
local i = 1;
for token in string.gmatch(randomfollow, "[^,]+") do
t[i] = token;
i= i + 1;
end
tmp.RandomFollow = t;
end
if( randombefore ) then
local t = {}
local i = 1;
for token in string.gmatch(randombefore, "[^,]+") do
t[i] = token;
i= i + 1;
end
tmp.RandomBefore = t;
end
EDIT: This was only an example in which way it can be implemented in database.lua
Re: reqbuffname on skill to have 2 buffs?
Posted: Tue Jul 28, 2015 12:25 am
by BlubBlab
okay the other side is:
Code: Select all
-- Check required buffs/debuffs
for key,reqbuff in pairs(self.ReqBuffName) do
local count = 0
if(self.ReqBuffCount[key])then
count = ReqBuffCount[key]
end
if( reqbuff ~= "" and reqbuff ~= "nil") then
local bool;
if( self.ReqBuffTarget == "player" ) then
bool = player:hasBuff(reqbuff, count)
elseif target and ( self.ReqBuffTarget == "target" ) then
bool = target:hasBuff(reqbuff, count)
end
if bool == false then
debug_skilluse("REQBUFF");
return false
end
end
end
-- Check non-required buffs/debuffs
for key,nobuff in pairs(self.NoBuffName) do
local count = 0
if(self.NoBuffCount[key])then
count = NoBuffCount[key]
end
if( nobuff ~= "" and nobuff ~= "nil") then
local bool;
if( self.NoBuffTarget == "player" ) then
bool = player:hasBuff(nobuff, count)
elseif target and ( self.NoBuffTarget == "target" ) then
bool = target:hasBuff(nobuff, count)
end
if bool == true then
debug_skilluse("NOBUFF");
return false
end
end
end
and natrually you must change the init values in skill.lua