summaryrefslogtreecommitdiff
path: root/example/scripts/npcs
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-11 18:54:38 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-11 19:27:41 +0100
commit017cae4e98e02c3c754e844ae55fe155a0d2e095 (patch)
treeab80771311a499010f06ac8e6b58fe1cae18d95f /example/scripts/npcs
parent5ff34fd2458dff28d664c90fb93f455231f8633c (diff)
downloadmanaserv-017cae4e98e02c3c754e844ae55fe155a0d2e095.tar.gz
manaserv-017cae4e98e02c3c754e844ae55fe155a0d2e095.tar.bz2
manaserv-017cae4e98e02c3c754e844ae55fe155a0d2e095.tar.xz
manaserv-017cae4e98e02c3c754e844ae55fe155a0d2e095.zip
Converted two Lua scripts from DOS to UNIX line endings
Diffstat (limited to 'example/scripts/npcs')
-rw-r--r--example/scripts/npcs/shaker.lua88
1 files changed, 44 insertions, 44 deletions
diff --git a/example/scripts/npcs/shaker.lua b/example/scripts/npcs/shaker.lua
index 768fc126..c6be0638 100644
--- a/example/scripts/npcs/shaker.lua
+++ b/example/scripts/npcs/shaker.lua
@@ -1,44 +1,44 @@
-----------------------------------------------------------------------------------
--- Copyright 2009-2010 The Mana World Development Team --
--- --
--- This file is part of The Mana World. --
--- --
--- The Mana World is free software; you can redistribute it and/or modify it --
--- under the terms of the GNU General Public License as published by the Free --
--- Software Foundation; either version 2 of the License, or any later version. --
-----------------------------------------------------------------------------------
-
-shake_count = 0
-
-function shaker_update(npc)
- shake_count = shake_count + 1
- if shake_count > 20 then
- shake_count = 0
-
- center_x = posX(npc)
- center_y = posY(npc)
- tremor(center_x, center_y, 300)
- end
-end
-
--- function which causes a screen shake effect for all players near a
--- certain point with an intensity and direction relative to said point
-function square(x)
- return x * x
-end
-
-function tremor (center_x, center_y, intensity)
- for dummy, object in ipairs(get_beings_in_circle(center_x, center_y, intensity)) do
- if being_type(object) == TYPE_CHARACTER then
- object_x = posX(object)
- object_y = posY(object)
- dist_x = object_x - center_x
- dist_y = object_y - center_y
- dist = math.sqrt(square(dist_x) + square(dist_y))
- intensity_local = intensity - dist
- intensity_x = (intensity - dist) * (dist_x / dist) / 5
- intensity_y = (intensity - dist) * (dist_y / dist) / 5
- chr_shake_screen(object, intensity_x, intensity_y)
- end
- end
-end
+----------------------------------------------------------------------------------
+-- Copyright 2009-2010 The Mana World Development Team --
+-- --
+-- This file is part of The Mana World. --
+-- --
+-- The Mana World is free software; you can redistribute it and/or modify it --
+-- under the terms of the GNU General Public License as published by the Free --
+-- Software Foundation; either version 2 of the License, or any later version. --
+----------------------------------------------------------------------------------
+
+shake_count = 0
+
+function shaker_update(npc)
+ shake_count = shake_count + 1
+ if shake_count > 20 then
+ shake_count = 0
+
+ center_x = posX(npc)
+ center_y = posY(npc)
+ tremor(center_x, center_y, 300)
+ end
+end
+
+-- function which causes a screen shake effect for all players near a
+-- certain point with an intensity and direction relative to said point
+function square(x)
+ return x * x
+end
+
+function tremor (center_x, center_y, intensity)
+ for dummy, object in ipairs(get_beings_in_circle(center_x, center_y, intensity)) do
+ if being_type(object) == TYPE_CHARACTER then
+ object_x = posX(object)
+ object_y = posY(object)
+ dist_x = object_x - center_x
+ dist_y = object_y - center_y
+ dist = math.sqrt(square(dist_x) + square(dist_y))
+ intensity_local = intensity - dist
+ intensity_x = (intensity - dist) * (dist_x / dist) / 5
+ intensity_y = (intensity - dist) * (dist_y / dist) / 5
+ chr_shake_screen(object, intensity_x, intensity_y)
+ end
+ end
+end