Action [Release] Annihilator v2.1

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,698
Best answers
211
Reaction score
1,398
Location
Norway, Oslo
local room = { -- room with demons
fromX = 80,
fromY = 122,
fromZ = 7,
--------------
toX = 83,
toY = 126,
toZ = 7
}
what to change here for it to work on My server?
Anni looks like this:

X = Coal Basin (Fire)
D = demon
L = lava
P = Player

Code:
D	X	D	X		 |   quest quest quest quest
L	L	L	L		 |
P	P	P	P	D	D|<--- door
L	L	L	L		 |
X	D	X	D		 |  teleport out of room ----->
From x,y.z to x,y,z
Code:
HERE	X	D	X
L	L	L	L
P	P	P	P	D	D
L	L	L	L
X	D	X	D		HERE
Upper left to lower right.

The purpose is because we want the script to spawn demons. Not the map editor.

Because if it would be map editor, you could make another team join as fast as possible right after a team has succeed.
And perhaps you could wait for re-spawn to kill demons.
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,698
Best answers
211
Reaction score
1,398
Location
Norway, Oslo
Just noticed that I am not using Shawaks script. <.<

Well my explanation is still correct right?

Ohh never-mind it seem like we both explained the same thing but used different tutorial methods. C:

I am master of code-mapping. :D
 

Elaney

Member
Joined
Jan 1, 2009
Messages
1,551
Best answers
0
Reaction score
11
Location
Sweden
cant give you rep but great script. not going to use it but i learn some from it =)
 

bialas3

New Member
Joined
Jun 28, 2010
Messages
12
Best answers
0
Reaction score
0
Hi, I have
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/Annihilator.lua)
data/actions/scripts/quests/Annihilator.lua:1: unexpected symbol near '˙'
in server's console. What do with it?
 
Last edited:

Elda Swok

Searching New Project
Joined
Jun 18, 2008
Messages
703
Best answers
0
Reaction score
9
Location
Pittsburgh, Pa.
[29/07/2010 11:10:44] [Error - LuaScriptInterface::loadFile] data/actions/scripts/quests/annihilator.lua:42: '}' expected (to close '{' at line 35) near 'local'
[29/07/2010 11:10:44] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua)
[29/07/2010 11:10:44] data/actions/scripts/quests/annihilator.lua:42: '}' expected (to close '{' at line 35) near 'local''

I'm getting these errors, I looked for the TFS verison list you gave, I'm using 3.4.6 and getting that error. Any clues?

Code:
       -- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 1069,
        fromY = 1129,
        fromZ = 10,
        --------------
        toX = 1074,
        toY = 1129,
        toZ = 10
        }

        local monster_pos = {
		
        [1] = {pos = {1069, 1127, 10}, monster = "Demon"},
        [2] = {pos = {1071, 1127, 10}, monster = "Demon"},
        [3] = {pos = {1073, 1127, 10}, monster = "Demon"},
        [4] = {pos = {1069, 1131, 10}, monster = "Demon"},
        [5] = {pos = {1071, 1131, 10}, monster = "Demon"},
        [6] = {pos = {1073, 1131, 10}, monster = "Demon"},
		[7] = {pos = {1073, 1129, 10}, monster = "Demon"},
		[8] = {pos = {1074, 1129, 10}, monster = "Demon"}
		
        }

        local players_pos = {
        {x = 1082, y =1129, z = 9, stackpos = 253},
        {x = 1081, y =1129, z = 9, stackpos = 253},
        {x = 1080, y =1129, z = 9, stackpos = 253},
        {x = 1079, y =1129, z = 9, stackpos = 253}
        }

        local new_player_pos = {
        {x = 1072, y =1129, z = 10},
        {x = 1071, y =1129, z = 10},
        {x = 1070, y =1129, z = 10},
        {x = 1069, y =1129, z = 10,
        }

        local playersOnly = "no"
        local questLevel = 1001

        ------------------------------------------------------
        --- CONFIG END ---------------------------------------
        ------------------------------------------------------

function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player[i].uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then 
                                        for _, area in pairs(monster_pos) do
                                                        doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]})
                                        end
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")           
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end
 

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,921
Best answers
0
Reaction score
56
Update Version MOD Shawak ?

Thx.
 

cesar10

Active Member
Joined
Aug 4, 2009
Messages
425
Best answers
0
Reaction score
35
dont work and no errors on console S:
 

baralala

New Member
Joined
Jan 15, 2009
Messages
120
Best answers
0
Reaction score
1
Location
Argentina
when i press switch, it show me this error:

[31/10/2009 21:18:46] Lua Script Error: [Action Interface]
[31/10/2009 21:18:46] data/actions/scripts/quests/annihilator.lua:eek:nUse

[31/10/2009 21:18:46] luaGetThingFromPos(). Tile not found
I fixed it changing getthingfrompos to getTopCreature

Thx for script Shawak
 

Rollern

Active Member
Joined
Sep 8, 2010
Messages
179
Best answers
0
Reaction score
27
Uisng 0.3.6: Error: getThingFromPos... Tile not found? Anyone? :) Thanks in advance.
 

Newpy

New Member
Joined
May 5, 2010
Messages
50
Best answers
0
Reaction score
1
@up i get same error, all positions are correct.
 

Limos

Premium User
Joined
Jun 7, 2010
Messages
10,018
Best answers
7
Reaction score
2,959
Location
Netherlands
Add [ i ] after player and player_pos, like in the script Elda Swok posted. It's removed from the script because of the missing Lua tags.
So like this
Code:
player[i] = getThingfromPos(players_pos[i])
if player[i].itemid > 0 then
-- etc
You can also just use the one Elda Swok posted, it only gives the '}' expected error because there is a } missing in the table: {x = 1069, y =1129, z = 10}
 

Womos

New Member
Joined
Dec 20, 2015
Messages
26
Best answers
0
Reaction score
0
"There is already a team in the quest room." Yes nice feature BUT what if player decide to block quest? kill demons on both sides and just stay on bot with anti idle and nobody will be able to do the quest through all day LOL
 
Top