How do you add buffs to players such as 2h's, regens, other buffs as such? also if you need a buff value where could I find that?
I have been on other private servers and seen GM's just add a buff on the spot to a player.
Adding buffs to yourself/others
Re: Adding buffs to yourself/others
look at @addeffect
then look at status.lua
then look at status.lua
-
- Posts: 4
- Joined: Sun May 26, 2013 10:58 pm
Re: Adding buffs to yourself/others
Can you manipulate the duration and level within the command?
After some playing around I have found they are all like level 1 effect and last roughly 30 secs no matter the spell...
Is there a format to the command such as:
@addeffect <effect id> <level> <duration> <--- don't know if this works, I am asking if there is something like this
ex.
@addeffect 40 5 60 (would give protect 5 for 60 mins IF that were the command)
After some playing around I have found they are all like level 1 effect and last roughly 30 secs no matter the spell...
Is there a format to the command such as:
@addeffect <effect id> <level> <duration> <--- don't know if this works, I am asking if there is something like this
ex.
@addeffect 40 5 60 (would give protect 5 for 60 mins IF that were the command)
Re: Adding buffs to yourself/others
@addeffect has subparams that handle the duration and such for the effect you are adding. Check out the source to see how the params are used.
Re: Adding buffs to yourself/others
I don't understand why it is so hard to Read through the .lua file for the command....
When i had said take a look at @addeffect i meant open Up the addeffect.lua file and look through it...
It clearly states how it works, and what the params are right in the function.
Incase you missed it.....
So that makes it @addeffect Target SpellID Power Duration
If you do not specify a target it will put the buff on you.
When i had said take a look at @addeffect i meant open Up the addeffect.lua file and look through it...
It clearly states how it works, and what the params are right in the function.
Code: Select all
---------------------------------------------------------------------------------------------------
-- func: addeffect
-- auth: Lautan
-- desc: Adds the given effect to the given player.
---------------------------------------------------------------------------------------------------
cmdprops =
{
permission = 1,
parameters = "siii"
};
function onTrigger(player, target, id, power, duration)
-- Ensure a target is set..
if (target == nil) then
player:PrintToPlayer( "Target required; cannot be nil." );
return;
end
local effectTarget = player;
-- check if target name was entered
local num = tonumber(target)
if (type(num) == "number") then
if (power == 0 or power == nil) then
duration = 60;
else
duration = power;
end
if (id == 0 or id == nil) then
power = 1;
else
power = id;
end
id = num
else
local pc = GetPlayerByName(target);
if (pc ~= nil) then
effectTarget = pc;
else
return;
end
if (power == nil) then
power = 1;
end
if (duration == nil) then
duration = 60;
end
if (id == 0 or id == nil) then
id = 1;
end
end
if (id == nil) then
player:PrintToPlayer( "Effect id cannot be nil." );
return;
end
if (effectTarget:addStatusEffect(id, power, 3, duration)) then
effectTarget:messagePublic(280, effectTarget, id, id);
else
effectTarget:messagePublic(283, effectTarget, id);
end
end
Code: Select all
function onTrigger(player, target, id, power, duration)
So that makes it @addeffect Target SpellID Power Duration
If you do not specify a target it will put the buff on you.
-
- Posts: 4
- Joined: Sun May 26, 2013 10:58 pm
Re: Adding buffs to yourself/others
My apologies, I am definitely new to this but I am slowly coming along, thank you for your help.