• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Killing monster quest

Kramer infernal

I work alone =/
Joined
Jun 18, 2008
Messages
225
Reaction score
0
Hi, Someone know, or maybe create (sorry xD) the script for the actual game that's like

P1 = Player 1
Npc = NPC -.-

P1: Hi
NPC: hello young P1
P1: Mission
NPC: Do you really want the mission?
P1: Yes
NPC: The demons attacked my baby and they drink his blood T_T maybe you can revenge him? Ok, kill 1000 demons so my revenge can be complete

AFTER 1000 Demons killed the girl give you A LOT of exp and blablabla, any suggestions? ^^
 
ALL CREDITS TO Pedro B.

Well, if your server supports onKill(), then it is possible.

<event name="WOLF_KILL" type="kill" script="wolf_kill.lua"/>
wolf_kill.lua
function onKill(cid, target)
if(getPlayerStorageValue(cid, 6001) == 1) then
if(getCreatureName(target) == "TARGET") then
local store = getPlayerStorageValue(cid, 6000)
setPlayerStorageValue(cid, 6000, ((store==-1 and 1) or store+1))
if(getPlayerStorageValue(cid, 6000) == 20) then
doPlayerSendTextMessage(cid, MSG_INFO_DESCR, "You killed all wolves! GRATZ!")
setPlayerStorageValue(cid, 6001, 2)
end
end
end
return TRUE
end



Then, add this inside your login.lua, before the last return:
if(getPlayerPlayerStorageValue(cid, 6001) == 1) then
registerCreatureEvent(cid, "WOLF_KILL")
end




Now, on the NPC, verify the storage value 6001. less than 1 means he hasn't done the quest. 1 means he is doing the quest. 2 means he killed all wolves.

When you give the quest to him, don't forget you need this:
setPlayerStorageValue(cid, 6001, 1)
registerCreatureEvent(cid, "WOLF_KILL")
 
ALL CREDITS TO Pedro B.

Well, if your server supports onKill(), then it is possible.






Then, add this inside your login.lua, before the last return:





Now, on the NPC, verify the storage value 6001. less than 1 means he hasn't done the quest. 1 means he is doing the quest. 2 means he killed all wolves.

When you give the quest to him, don't forget you need this:

Understood but amm... I like to see quests before I add XD so, where Is the script what tests if it wolf or not o.o I don't saw anything sorry :P
 
Here
Code:
wolf_kill.lua
function onKill(cid, target)
if(getPlayerStorageValue(cid, 6001) == 1) then
if(getCreatureName(target) == "[COLOR="Red"]TARGET[/COLOR]") then
local store = getPlayerStorageValue(cid, 6000)
setPlayerStorageValue(cid, 6000, ((store==-1 and 1) or store+1))
if(getPlayerStorageValue(cid, 6000) == 20) then
doPlayerSendTextMessage(cid, MSG_INFO_DESCR, "You killed all wolves! GRATZ!")
setPlayerStorageValue(cid, 6001, 2)
end
end
end
return TRUE
end
 
ALL CREDITS TO Pedro B.

Well, if your server supports onKill(), then it is possible.






Then, add this inside your login.lua, before the last return:





Now, on the NPC, verify the storage value 6001. less than 1 means he hasn't done the quest. 1 means he is doing the quest. 2 means he killed all wolves.

When you give the quest to him, don't forget you need this:

another question...
If I want to bother players saying how much monsters got killed atm (I mean, my quests will be about 1000, 2000 monsters...) and I want to advise players how much monsters left xD

It will be some like

Code:
if(getPlayerStorageValue(cid,6000) => 1) and (getPlayerStorageValue(cid,6000) =< 1999) then
doPlayerSendTextMessage(cid, MSG_INFO_DESCR, "Have owned" getPlayerStorageValue(cid,6000) "Wolves")


It would be ok, sorry am really really outdated :P
 
Code:
local monsters_to_kill = 200
local monster_name = "Demon"

function onKill(cid, target)
         if(getPlayerStorageValue(cid, 6001) >= 1) and (getPlayerStorageValue(cid, 6001) < monsters_to_kill) then
                  if(getCreatureName(target) == monster_name) then
                           local store = getPlayerStorageValue(cid, 6000)
                           setPlayerStorageValue(cid, 6000, ((store==-1 and 1) or store+1))
                           if(getPlayerStorageValue(cid, 6000) == monsters_to_kill) then
                                    doPlayerSendTextMessage(cid, MSG_INFO_DESCR, "You have killed " .. monsters_to_kill .. " Demons! Go to NPCNAME and get your reward.")
                           else
                                    doPlayerSendTextMessage(cid, MSG_INFO_DESCR, "You have killed " .. getPlayerStorageValue(cid, 6000) .. "/" .. monsters_to_kill .. " Demons.")
                           end
                  end
         end
         return TRUE
end

maybe this will help you a bit.
 
Back
Top