Hi, I would like to present scripts.
Credits:
*Oryginal Idea
In actions.xml add
Now create a file in the scripts quest.lua
Enter it:
I hope that it will not disturb you that there is no script optimization.
Screen:
Any errors reported in this topic.
If you like this script
Give Rep click here --->Rep+
Credits:
*Oryginal Idea
[USER]Gelio[/USER]
*The skeleton of a formula which examines the monsters--[USER]Tairens[/USER]
*Organizing this together, fix a few bugs[USER]Aragornkk[/USER]
Now let's get to the pointIn actions.xml add
Code:
<action actionid="7897" event="script" value="quest.lua"/>
Enter it:
PHP:
function onUse(cid, item, frompos, item2, topos)
local item = 2160 --nobody
local monsters = {"rat", "rat", "rat", "rat"}
local positions = {{x=150, y=56, z=6}, {x=151, y=56, z=6}, {x=151, y=57, z=6}, {x=152, y=56, z=6}}
local pos = getCreaturePos(cid)
local poses = getArea(pos, 8, 8)
local monster = 0
local monsterNumber = 0
for i = 1, #poses do
monster = getTopCreature(poses[i]).uid
if(isMonster(monster) == true) then
monsterNumber = monsterNumber + 1
end
if monsterNumber ~= 0 and getPlayerStorageValue(cid,9998)==1 then
doPlayerSendTextMessage(cid,22,"The killing has been ".. monsterNumber .." pieces.")
end
end
if getPlayerStorageValue(cid,9998)== -1 and getGlobalStorageValue(cid,9996)==-1 and monsterNumber== 0 then
addEvent(reseter, 100*1000, cid)
setGlobalStorageValue(9996, 1)
setPlayerStorageValue(cid,9998, 1)
for i=1, #monsters do
doSummonCreature(monsters[i], positions[i])
end
elseif getPlayerStorageValue(cid,9998)==1 and getGlobalStorageValue(cid,9996)==1 and monsterNumber==0 then
doPlayerSendTextMessage(cid,22,"Congratulations to the implementation of the quest!")
doPlayerAddItem(cid,2160,1)
setPlayerStorageValue(cid,9998, 2)
elseif getPlayerStorageValue(cid,9998)== 2 then
doPlayerSendTextMessage(cid,22,"Nothing is here!")
end
return true
end
function reseter(cid)
setGlobalStorageValue(9996, -1)
if getPlayerStorageValue(cid,9998)==1 then
setPlayerStorageValue(cid,9998, -1)
end
end
Screen:
Any errors reported in this topic.
If you like this script
Give Rep click here --->Rep+
Last edited: