From f31277b327df701361391b1d4b8bd6f89f4e3109 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 27 Apr 2013 21:09:23 +0200 Subject: [Abilities] Removed the old autoattack system As a side effect i had to remove the monster attack AI for now. I will readd this as next thing. --- example/scripts/maps/desert.lua | 2 -- example/scripts/monster/testmonster.lua | 14 -------------- 2 files changed, 16 deletions(-) (limited to 'example/scripts') diff --git a/example/scripts/maps/desert.lua b/example/scripts/maps/desert.lua index 5f7f2d28..343ee6c4 100644 --- a/example/scripts/maps/desert.lua +++ b/example/scripts/maps/desert.lua @@ -130,13 +130,11 @@ function Tamer(npc, ch, list) end local m1 = monster_create("Maggot", ch:position()) - m1:change_anger(ch, 100) -- (The following is not safe, since the being might have been removed by -- the time this function gets executed (especially with the above code)) -- --schedule_in(0.5, function() -- m1:say("Roaaarrrr!!!") - -- m1:change_anger(ch, 100) -- end) end diff --git a/example/scripts/monster/testmonster.lua b/example/scripts/monster/testmonster.lua index 21b6a7b2..42cf1d2d 100644 --- a/example/scripts/monster/testmonster.lua +++ b/example/scripts/monster/testmonster.lua @@ -14,19 +14,5 @@ local function update(mob) end end -local function strike(mob, victim, hit) - if hit > 0 then - mob:say("Take this! "..hit.." damage!") - victim:say("Oh Noez!") - else - mob:say("Oh no, my attack missed!") - victim:say("Whew...") - end -end - local maggot = get_monster_class("maggot") maggot:on_update(update) -local attacks = maggot:attacks(); -for i, attack in ipairs(attacks) do - attack:on_attack(strike) -end -- cgit v1.2.3-70-g09d2