Problem z Ani

GoD Scoorpion

New User
Zarejestrowany
Dołączył
Listopad 8, 2009
Posty
8
Liczba reakcji
0
mam taki problem ze mozna wzias 1 nagrode to ok ale jak np wykona ktos 2 raz ani to znowo moze wzias nagrode czemu ;/??
to m?j skrypt odp plz szybko
Kod:
function onUse(cid, item, frompos, item2, topos)
	if item.uid == 5000 and item.itemid == 1945 then
		player1pos = {x=500, y=755, z=9, stackpos=253}
		player1 = getThingfromPos(player1pos)
		player2pos = {x=499, y=755, z=9, stackpos=253}
		player2 = getThingfromPos(player2pos)
		player3pos = {x=498, y=755, z=9, stackpos=253}
		player3 = getThingfromPos(player3pos)
		player4pos = {x=497, y=755, z=9, stackpos=253}
		player4 = getThingfromPos(player4pos)
			if player1.itemid > 0 and player2.itemid > 0 and player3.itemid > 0 and player4.itemid > 0 then
				nplayer1pos = {x=500, y=755, z=10}
				nplayer2pos = {x=499, y=755, z=10}
				nplayer3pos = {x=498, y=755, z=10}
				nplayer4pos = {x=497, y=755, z=10}
				doSendMagicEffect(player1pos,2)
				doSendMagicEffect(player2pos,2)
				doSendMagicEffect(player3pos,2)
				doSendMagicEffect(player4pos,2)
				doTeleportThing(player1.uid,nplayer1pos)
				doTeleportThing(player2.uid,nplayer2pos)
				doTeleportThing(player3.uid,nplayer3pos)
				doTeleportThing(player4.uid,nplayer4pos)
				doSendMagicEffect(nplayer1pos,10)
				doSendMagicEffect(nplayer2pos,10)
				doSendMagicEffect(nplayer3pos,10)
				doSendMagicEffect(nplayer4pos,10)
				demon1pos = {x=502, y=755, z=10}
				demon2pos = {x=501, y=755, z=10}
				demon3pos = {x=499, y=757, z=10}
				demon4pos = {x=497, y=757, z=10}
				demon5pos = {x=498, y=753, z=10}
				demon6pos = {x=500, y=753, z=10}
				doSummonCreature("Demon", demon1pos)
				doSummonCreature("Demon", demon2pos)
				doSummonCreature("Demon", demon3pos)
				doSummonCreature("Demon", demon4pos)
				doSummonCreature("Demon", demon5pos)
				doSummonCreature("Demon", demon6pos)
				else
				doPlayerSendCancel(cid,"You need 4 players.")
			end
		else
		return 0
   	end
	return 1
end
 
Odp: Problem z Ani

Hi.

Credits: By Shawak

data/actions/actions.xml
PHP:
<action uniqueid="3030" event="script" value="Annihilator.lua"/>

data/actions/scripts/annihilator.lua
PHP:
        -- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 870,
        fromY = 1035,
        fromZ = 7,
        --------------
        toX = 875,
        toY = 1039,
        toZ = 7
        }

        local monster_pos = {
        [1] = {pos = {870, 1035, 7}, monster = "Demon"},
        [2] = {pos = {872, 1035, 7}, monster = "Demon"},
        [3] = {pos = {871, 1039, 7}, monster = "Demon"},
        [4] = {pos = {873, 1039, 7}, monster = "Demon"},
        [5] = {pos = {874, 1037, 7}, monster = "Demon"},
        [6] = {pos = {875, 1037, 7}, monster = "Demon"}
        }

        local players_pos = {
        {x = 895, y =1037, z = 7, stackpos = 253},
        {x = 895, y =1038, z = 7, stackpos = 253},
        {x = 895, y =1039, z = 7, stackpos = 253},
        {x = 895, y =1040, z = 7, stackpos = 253}
        }

        local new_player_pos = {
        {x = 873, y = 1037, z = 7},
        {x = 872, y = 1037, z = 7},
        {x = 871, y = 1037, z = 7},
        {x = 870, y = 1037, z = 7}
        }

        local playersOnly = "no"
        local questLevel = 101

        ------------------------------------------------------
        --- 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

ODRAZU M?WIE SKRYPT NIE M?J !

Bye.
 
Odp: Problem z Ani

witam sorki nic z tego nie kumam;/ mozesz mi to zrobic z moimi pos? plz i czemu 3030?
<action uniqueid="3030"
 
Odp: Problem z Ani

Uzupe?ni?em Ci warto?ci pozycji :)
Kod:
  -- Annihilator by Shawak v2.1

        -- CONFIG --

        local room = {     -- room with demons
        fromX = 497,
        fromY = 753,
        fromZ = 10,
        --------------
        toX = 500,
        toY = 757,
        toZ = 10
        }

        local monster_pos = {
        [1] = {pos = {502, 755, 7}, monster = "Demon"},
        [2] = {pos = {501, 755, 7}, monster = "Demon"},
        [3] = {pos = {499, 757, 7}, monster = "Demon"},
        [4] = {pos = {497, 757, 7}, monster = "Demon"},
        [5] = {pos = {498, 753, 7}, monster = "Demon"},
        [6] = {pos = {500, 753, 7}, monster = "Demon"}
        }

        local players_pos = {
        {x=500, y=755, z=9, stackpos=253},
        {x=499, y=755, z=9, stackpos=253},
        {x=498, y=755, z=9, stackpos=253},
		{x=497, y=755, z=9, stackpos=253}
        }
        local new_player_pos = {
        {x=500, y=755, z=10},
        {x=499, y=755, z=10},
		{x=498, y=755, z=10},
        {x=497, y=755, z=10}
        }

        local playersOnly = "no"
        local questLevel = 101

        ------------------------------------------------------
        --- 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
Skorzysta?em z pozycji kt?re da?e? w 1 po?cie :p
 
Odp: Problem z Ani

4942519 moje gg napisz a jak cos to w moim poscie masz all podane dane w silniku mam taki b?ad

[08/11/2009 23:11:17] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/quests/annihilator.lua.lua)
[08/11/2009 23:11:17] cannot open data/actions/scripts/quests/annihilator.lua.lua: No such file or directory
[08/11/2009 23:11:17] [Warning - Actions::registerEvent] Duplicate registered item uid: 2414
 
Ostatnia edycja:
Odp: Problem z Ani

Po prostu dwa razy doda?e? skrypt na anhi.
Podmie? zawarto?? starego anhi.
 
Odp: Problem z Ani

W quest.lua

KOD: napisał:
-- Script by Magic
function onUse(cid, item, fromPosition, itemEx, toPosition)z
local st = 6530
local nagroda1 = xxxx -- Tu wpisz ID itema z 1 skrzynki (Actions ID Skrzynki - 1111)
local nagroda2 = xxxx -- Tu wpisz ID itema z 1 skrzynki (Actions ID Skrzynki - 1112)
local nagroda3 = xxxx -- Tu wpisz ID itema z 1 skrzynki (Actions ID Skrzynki - 1113)
local nagroda4 = xxxx -- Tu wpisz ID itema z 1 skrzynki (Actions ID Skrzynki - 1114)
if getPlayerStorageValue(cid,st) == 1 then
doPlayerSendTextMessage(cid,22,"Wybrales juz")
elseif getPlayerStorageValue(cid,st) == 0 and item.aid == 1111 then
doPlayerAddItem(uid,nagroda1,1)
setPlayerStorageValue(uid,st,2)
elseif getPlayerStorageValue(cid,st) == 0 and item.aid == 1112 then
doPlayerAddItem(uid,nagroda2,1)
setPlayerStorageValue(uid,st,2)
elseif getPlayerStorageValue(cid,st) == 0 and item.aid == 1113 then
doPlayerAddItem(uid,nagroda3,1)
setPlayerStorageValue(uid,st,2)
elseif getPlayerStorageValue(cid,st) == 0 and item.aid == 1114 then
doPlayerAddItem(uid,nagroda4,1)
setPlayerStorageValue(uid,st,2)
return 1
end
end

A do actions:

KODD: napisał:
<action actionid="1111" script="quest.lua" />
<action actionid="1112" script="quest.lua" />
<action actionid="1113" script="quest.lua" />
<action actionid="1114" script="quest.lua" />


Uzupe?ni? tylko ID Itemk?w, da? ID skrzynk? (map editor)
Oraz... zrobi? questa !

WZIELEM TO Z INNEGO FORUM ZE PEWNEGO WZGLEDU NIE PODAM JAKIEGO...
 
Ostatnia edycja:
Back
Do góry