Witam.
Chcia?by kto? pom?c uzupe?ni? skrypt i zarazem edytowa? go pod (movements) by aktywowa?o go 1 SQM?
By?bym bardzo wdzi?czny.
[LUA]function onUse(cid, item, fromPosition, itemEx, toPosition)
local center = {x=2162,y=2249,z=10} --Centrum pozycji od jakiej beda sie {respily moby [w prawo]}
local effectCenterPos;
local debugMode = false;
local allStages = 8; --WAZNE! LICZBA WSZYSTKICH LEVELI \/ Z TEGO PONIZEJ
local stages = {
[-1] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 1; -- na pierwszym jest 2 wiecej czyli realnie underStages + 2
--Under Stages czyli liczba fal mobow podanych w danej rundzie
},
[0] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 3;
},
[1] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 5;
},
[2] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 3;
},
[3] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 2;
},
[4] = {
monsters = {"Dragon","Cave Rat","Dragon Lord","Rotworm","Rotworm"},
underStages = 4;
},
[5] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 5;
},
[6] = {
monsters = {"Cave Rat","Cave Rat","Demon","Rotworm","Demon"},
underStages = 4;
}
}
local endStorage = 46183; --Storage okreslajace ukonczenie questa i mozliwosc odebrania nagrod - 2 // 1 - mozna zaczac questa tj wybijac to
local underStageStorage = 46181;
local monsterStorage = 46182;
local playerStorage = getPlayerStorageValue(cid,monsterStorage)
local playerUnderStorage = getPlayerStorageValue(cid,underStageStorage)
local function currentMonsters(cid)
for i = 1, #stages[playerStorage].monsters do
monster = doCreateMonster(stages[playerStorage].monsters,center)
effectCenterPos = getCreaturePos(monster)
effectCenterPos = {x = effectCenterPos.x +1,y = effectCenterPos.y+1,z = effectCenterPos.z}; ---to sobie mozna usunac, mi to jest potrzebne bo mam przesuniety efekt w spr
doSendMagicEffect(effectCenterPos, 290)
doSendAnimatedText(center, 'SPAWNED', 70)
center.x = center.x +1;
end
return true
end
local function UpdateStage(cid)
setPlayerStorageValue(cid,underStageStorage,player UnderStorage + 1)
if(playerUnderStorage == stages[playerStorage].underStages) then
setPlayerStorageValue(cid,monsterStorage,playerSto rage + 1)
setPlayerStorageValue(cid,underStageStorage,0)
end
return true
end
local function resetStorages(cid)
setPlayerStorageValue(cid,underStageStorage,-1)
setPlayerStorageValue(cid,monsterStorage,-1)
setPlayerStorageValue(cid,endStorage,-1);
end
local function MessageStage()
local function stage()
local stage = playerUnderStorage
if(stage < 1) then
stage = 0;
end
return stage;
end
doSendAnimatedText(getPlayerPosition(cid), 'Stage '..stage()..'', 70)
end
if(debugMode) then
resetStorages(cid)
print("Debug zakonczony");
return false;
end
if(getPlayerStorageValue(cid,endStorage) == -1) then
return false;
end
if(playerStorage+1 >= allStages) then
if(getPlayerStorageValue(cid,endStorage) ~= 2 and getPlayerStorageValue(cid,endStorage) ~= 3) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Stage Completed")
setPlayerStorageValue(cid,endStorage,2);
end
return false
end
currentMonsters(cid)
UpdateStage(cid)
MessageStage()
return true
end[/LUA]
Chcia?by kto? pom?c uzupe?ni? skrypt i zarazem edytowa? go pod (movements) by aktywowa?o go 1 SQM?
By?bym bardzo wdzi?czny.
[LUA]function onUse(cid, item, fromPosition, itemEx, toPosition)
local center = {x=2162,y=2249,z=10} --Centrum pozycji od jakiej beda sie {respily moby [w prawo]}
local effectCenterPos;
local debugMode = false;
local allStages = 8; --WAZNE! LICZBA WSZYSTKICH LEVELI \/ Z TEGO PONIZEJ

local stages = {
[-1] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 1; -- na pierwszym jest 2 wiecej czyli realnie underStages + 2
--Under Stages czyli liczba fal mobow podanych w danej rundzie
},
[0] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 3;
},
[1] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 5;
},
[2] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 3;
},
[3] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 2;
},
[4] = {
monsters = {"Dragon","Cave Rat","Dragon Lord","Rotworm","Rotworm"},
underStages = 4;
},
[5] = {
monsters = {"Cave Rat","Cave Rat","Minotaur","Rotworm","Rotworm"},
underStages = 5;
},
[6] = {
monsters = {"Cave Rat","Cave Rat","Demon","Rotworm","Demon"},
underStages = 4;
}
}
local endStorage = 46183; --Storage okreslajace ukonczenie questa i mozliwosc odebrania nagrod - 2 // 1 - mozna zaczac questa tj wybijac to
local underStageStorage = 46181;
local monsterStorage = 46182;
local playerStorage = getPlayerStorageValue(cid,monsterStorage)
local playerUnderStorage = getPlayerStorageValue(cid,underStageStorage)
local function currentMonsters(cid)
for i = 1, #stages[playerStorage].monsters do
monster = doCreateMonster(stages[playerStorage].monsters,center)
effectCenterPos = getCreaturePos(monster)
effectCenterPos = {x = effectCenterPos.x +1,y = effectCenterPos.y+1,z = effectCenterPos.z}; ---to sobie mozna usunac, mi to jest potrzebne bo mam przesuniety efekt w spr
doSendMagicEffect(effectCenterPos, 290)
doSendAnimatedText(center, 'SPAWNED', 70)
center.x = center.x +1;
end
return true
end
local function UpdateStage(cid)
setPlayerStorageValue(cid,underStageStorage,player UnderStorage + 1)
if(playerUnderStorage == stages[playerStorage].underStages) then
setPlayerStorageValue(cid,monsterStorage,playerSto rage + 1)
setPlayerStorageValue(cid,underStageStorage,0)
end
return true
end
local function resetStorages(cid)
setPlayerStorageValue(cid,underStageStorage,-1)
setPlayerStorageValue(cid,monsterStorage,-1)
setPlayerStorageValue(cid,endStorage,-1);
end
local function MessageStage()
local function stage()
local stage = playerUnderStorage
if(stage < 1) then
stage = 0;
end
return stage;
end
doSendAnimatedText(getPlayerPosition(cid), 'Stage '..stage()..'', 70)
end
if(debugMode) then
resetStorages(cid)
print("Debug zakonczony");
return false;
end
if(getPlayerStorageValue(cid,endStorage) == -1) then
return false;
end
if(playerStorage+1 >= allStages) then
if(getPlayerStorageValue(cid,endStorage) ~= 2 and getPlayerStorageValue(cid,endStorage) ~= 3) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Stage Completed")
setPlayerStorageValue(cid,endStorage,2);
end
return false
end
currentMonsters(cid)
UpdateStage(cid)
MessageStage()
return true
end[/LUA]