cleaned up magicstate and weaponskillstate

- todo: fix IsFacing
- added thunder spell (todo: figure out why battleactionx10 crashes client on sending shit)
This commit is contained in:
Tahir Akhlaq 2017-08-26 04:08:26 +01:00
parent 452f1cc8c0
commit 9024f3fad6
20 changed files with 415 additions and 195 deletions

View file

@ -21,7 +21,7 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
player:endEvent();
return;
end
--Does the target exist
target = player:getZone():FindActorInArea(targetActor);
if (target == nil) then
@ -30,7 +30,7 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
return;
end
player.Cast(command.actorId);
player.Cast(command.actorId, targetActor);
player:endEvent();
end

View file

@ -26,7 +26,10 @@ function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, ta
return;
end
player.WeaponSkill(command.actorId);
player:endEvent();
if not player.aiContainer.IsEngaged() then
player.Engage(targetActor);
end;
player.WeaponSkill(command.actorId, targetActor);
player:endEvent();
end

View file

@ -19,9 +19,9 @@ function onTrigger(player, argc, effectId, magnitude, tick, duration)
player.DelHP(500);
effectId = tonumber(effectId) or 223180;
magnitude = tonumber(magnitude) or 300;
magnitude = tonumber(magnitude) or 700;
tick = tonumber(tick) or 3;
duration = tonumber(duration) or 60;
duration = tonumber(duration) or 360;
while player.statusEffects.HasStatusEffect(effectId) do
player.statusEffects.RemoveStatusEffect(effectId);

View file

@ -6,25 +6,22 @@ function onGain(target, effect)
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
sender = "regen";
target.SendMessage(messageId, sender, "dicks");
end;
function onTick(target, effect)
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
sender = "regen";
-- todo: actual regen effect thing
local ability = GetWorldManager().GetAbility(27346);
local anim = bit32.bxor(bit32.lshift(ability.animationType, 24), bit32.lshift(tonumber(1), 12) , 101);
local addHp = effect.GetMagnitude();
target.AddHP(addHp);
target.SendBattleActionX01Packet(anim, 101, 0, 0, addHp);
target.SendMessage(messageId, sender, string.format("ate %u dicks", addHp));
-- target.SendBattleActionX01Packet(anim, 101, 0, 0, addHp);
end;
function onLose(target, effect)
messageId = MESSAGE_TYPE_SYSTEM_ERROR;
sender = "regen";
target.SendMessage(messageId, sender, "dicks gon");
end;

View file

@ -0,0 +1,18 @@
function onSpellPrepare(caster, target, spell)
return 0;
end;
function onSpellStart(caster, target, spell)
return 0;
end;
function onSpellFinish(caster, target, spell, action)
local damage = math.random(10, 100);
print("fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuckkk")
if target.hateContainer then
target.hateContainer.AddBaseHate(caster);
target.hateContainer.UpdateHate(caster, damage);
end;
return damage;
end;