• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Before we will reward the player must defeat monsters v 2.0

Aragornik

New Member
Joined
Mar 6, 2008
Messages
252
Reaction score
0
Hi, I would like to present scripts.
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 point
In actions.xml add
Code:
<action actionid="7897" event="script" value="quest.lua"/>
Now create a file in the scripts 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
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+
 
Last edited:
Great, Thanks.

It would be nice for the quest of:
Squeezing_Gear_of_Girlpower.gif
 
Last edited:
Back
Top