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

TalkAction [MOD] Kill monster quest(updated)

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
* Idea :
you set some config for monster:
# "rat" :
1- kills : 300
2- item : hydra egg(2) --item to start quest
3- money : 10000 -- money to start quest
4- lvl : 200 -- level to start quest
5- looktype : 20 -- the prize monster looktype
*Then Player Say !quest to know monster submitted in quest and all other commands like :
1- !check (monster) : know how many he killed
2- !change (monster) : change to monster outfit when he complete quest whenever he want
3- !disable (monster) : disable current quest

* Features :

1- Msg in pop ups
2- monster kills appear as animation when player kills the monster
(updadte) 3- when you kill the last monster you automatically get a msg and ability to use the outfit (just updated)


* Installation :
- just go to mods and make new xml and paste this inside:
#note : read the description quotes inside script


Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster Quest" version="1.0" author="Damadgerz" contact="[email protected]" enabled="yes">
 <description>
       This is description start edit from (config_toutorial) after description quote end.
        to add new monster add a comma and add a full line so like this:
                   m = { ["rat"] = {storage = 29000 , kills = 20, item = 7890 ,count = 2 , money = 10000, lvl= 2,look = 21}, 
              ["wolf"] = {storage = 29010, kills = 500, item = 7890 , count = 2 , money = 10000, lvl = 100 ,look = 27}, 
                  ["spider"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30},   --take care of comma here
                   ["demon"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30}   --here no comma last line
                  }        -storage for monster- how many kills-item to sstart outfit-count of item-money to start quest-lvl required to quest-look type of the monster.                 
                  
                  
                  *in msg just when you add new monster go add it in msg after \nSpider\nDemon\n\n so it be like this:
                  "Monsters in quest:\n\n\nRat\nWolf\nSpider..\nDemon>..\n\n  *To start quest say !start (monster)*\n *!disable: type monster to disable quest to start again item and money will be taken again and kills will be lost*\n*!check (monster) to know how many kills*"
                                                                           without dots
   </description>
        




<config name="tutorial_m"><![CDATA[
   m = { ["rat"] = {storage = 29000 , kills = 20, item = 7890 ,count = 2 , money = 10000, lvl= 2,look = 21}, 
              ["wolf"] = {storage = 29010, kills = 500, item = 7890 , count = 2 , money = 10000, lvl = 100 ,look = 27}, 
                  ["spider"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30}
                  }

         msg = "Monsters in quest :\n\n\nRat\nWolf\nSpider\n\n --------------------------------------\n* !quest : type monster to know requirements\n* !start : type monster name to start quest*\n* !disable : type monster to disable quest (to start again item and money will be taken again and all kills be lost)*\n* !check : type monster to know how many kills*\n* !change : type monster to get the outfit*"  
         storage1 = 2030

 ]]></config>
   <event type="login" name="Tutorial Login" event="script"><![CDATA[
        function onLogin(cid)
                registerCreatureEvent(cid, "test")
        return true
    end

]]></event>
    <event type="kill" name="test" event="script"><![CDATA[
        domodlib('tutorial_m')
        function onKill(cid, target)
        if(isPlayer(target) == TRUE) then
                return TRUE
        end

        local monster = m[string.lower(getCreatureName(target))]
        if(not monster) then
                return TRUE
        end
        if getPlayerStorageValue(cid,monster.storage) == ((monster.kills)-1) then
		    setPlayerStorageValue(cid,monster.storage, (monster.kills)+1)
			setPlayerStorageValue(cid,storage1,-1)
			   doPlayerPopupFYI(cid, "                          *#Congratulations!#*\n\n\n    You have completed the ["..getCreatureName(target).."] quest.\n\n   *Make !change "..getCreatureName(target).." to get the outfit when needed*")
        return true
        end
		if getPlayerStorageValue(cid,monster.storage) == ((monster.kills)+1) then

         return true
        end
      setPlayerStorageValue(cid, monster.storage ,(getPlayerStorageValue(cid, monster.storage))+1)
      doSendAnimatedText(getPlayerPosition(cid),""..getPlayerStorageValue(cid, monster.storage).."", math.random(01,255))
         return true
        end
]]></event>
<talkaction words="!quest" event="script"><![CDATA[
domodlib('tutorial_m')
function onSay(cid, words, param)
monster = m[param]
if (not monster) then
 doPlayerPopupFYI(cid, msg)
return true 
end 
if getPlayerStorageValue(cid,monster.storage) == monster.kills then
     doPlayerPopupFYI(cid, "                          *#Congratulations!#*\n\n\n    You have completed the ["..param.."] quest.\n\n   *Make !change "..param.." to get the outfit when needed*")
         return true
         end
   doPlayerPopupFYI(cid,"The ["..param.."] quest requires :\n\n\n *Level : "..monster.lvl.."\n\n*Item : "..getItemNameById(monster.item).."\n     count : " ..monster.count.."\n\n*Money : "..monster.money.." gold coins\n\n*kills : "..monster.kills..".") 
return true
 end



 ]]></talkaction>
 <talkaction words="!start" event="script"><![CDATA[
      domodlib('tutorial_m')
 function onSay(cid, words, param)
  local monster = m[param]
    if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
        if (not monster and getPlayerStorageValue(cid,storage1) ~= 0 ) then
                doPlayerSendCancel(cid,"monster dont have quest")
                        return true
                elseif (not monster and getPlayerStorageValue(cid,storage1) == 0) then
                   doPlayerSendTextMessage(cid, 19, "You already in quest.")
                   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
             return true
            end
            if getPlayerStorageValue(cid,storage1) == 0 then
                  doPlayerSendTextMessage(cid, 19, "You already in quest.")
                  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                 return true
                end
        if getPlayerStorageValue(cid,monster.storage) == ((monster.kills)+1) and (getPlayerLevel(cid) < monster.lvl or getPlayerItemCount(cid, monster.item) < monster.count or getPlayerMoney(cid) < monster.money) then
              
                  doCreatureSay(cid,"You already completed the "..param.." quest.", TALKTYPE_ORANGE_1)
           return true
           end
                if (getPlayerLevel(cid) < monster.lvl or getPlayerItemCount(cid, monster.item) < monster.count or getPlayerMoney(cid) < monster.money) then
                  doPlayerSendCancel(cid,"You dont have the required stuff (press !quest "..param.." to know what needed.")
                  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                  return true
                end
                if getPlayerStorageValue(cid,monster.storage) ==((monster.kills)+1) then
              
                  doCreatureSay(cid,"You already completed the "..param.." quest.", TALKTYPE_ORANGE_1)
           return true
           end
          doPlayerRemoveMoney(cid, monster.money)
          doPlayerRemoveItem(cid, monster.item, monster.count)
          doSendMagicEffect(getPlayerPosition(cid), 27)
         setPlayerStorageValue(cid, monster.storage ,0)
          setPlayerStorageValue(cid,storage1,0)
          doCreatureSay(cid,"You have started "..param.." quest.", TALKTYPE_ORANGE_1)
         return true 
        end




 ]]></talkaction>
 <talkaction words="!disable" event="script"><![CDATA[
domodlib('tutorial_m')  
  function onSay(cid, words, param)
 
  
  local monster = m[param]
  if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end

         if getPlayerStorageValue(cid,monster.storage) == ((monster.kills)+1) and getPlayerStorageValue(cid,storage1) ~= 0 then

                  doCreatureSay(cid,"You have copmeleted the "..param.." quest.", TALKTYPE_ORANGE_1)
           return true
           end
     if getPlayerStorageValue(cid,storage1) ~= 0 then
           doPlayerSendCancel(cid,"You must start a quest first.")
           return true
           end
           if getPlayerStorageValue(cid,monster.storage) == -1 then
            doPlayerSendCancel(cid,"You havn't started this monster quest.")
           return true
           end
           if getPlayerStorageValue(cid,monster.storage) == ((monster.kills)+1) then
		     
              setPlayerStorageValue(cid,storage1,-1)
                  doCreatureSay(cid,"You have copmeleted the "..param.." quest.", TALKTYPE_ORANGE_1)
           return true
           end
         setPlayerStorageValue(cid,storage1,-1)
         setPlayerStorageValue(cid,monster.storage,-1)
         doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You have disabled quest.")
         return true
         end
         
  ]]></talkaction>
 
 <talkaction words="!check" event="script"><![CDATA[
 
  domodlib('tutorial_m')
   function onSay(cid, words, param)
 if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
        monster = m[param]
  if (not monster) then
    doPlayerSendCancel(cid,"Monster not in quest.")
    return true
    end

 if getPlayerStorageValue(cid,monster.storage) < 0 then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "  *Kills : ["..param.."]\n              0/"..monster.kills.."")
  return true
  end
 
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "  *Kills : ["..param.."]\n              "..getPlayerStorageValue(cid,monster.storage).."/"..monster.kills.."")
  return true
 end
 
  ]]></talkaction>
  
  <talkaction words="!change" event="script"><![CDATA[
   domodlib('tutorial_m')
  function onSay(cid, words, param)
  
  local monster = m[param]
    if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
    if(not monster) then
         doPlayerSendCancel(cid,"Not in quest.")
         return true
         end
         if getPlayerStorageValue(cid,monster.storage) ~=((monster.kills) +1) then
           doPlayerSendCancel(cid,"YOu have to kill "..monster.kills.." "..param.." first.")
           return true
           end
     local tmp = getCreatureOutfit(cid)
        tmp.lookType = monster.look
      doCreatureChangeOutfit(cid, tmp)
          return true
          end
          ]]></talkaction>
 </mod>
* Apply for bugs .:p
 
Last edited:
no when you complet quest:
you have the ability to say !change (monster) when you like
when you relog you outfit become normal or when you edit your outfit
 
[25/06/2010 18:00:33] > Loading firstitems.xml... done.
[25/06/2010 18:00:33] > Loading highscorebook.xml... done.
[25/06/2010 18:00:33] > Loading Monster Quest.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/Monster Ques.xml
[25/06/2010 18:00:33] Line: 1, Info: XML declaration allowed only at the start of the document


[25/06/2010 18:00:33] failed!
[25/06/2010 18:00:33] > 7 mods were loaded.
[25/06/2010 18:00:33] >> Loading map and spawns...


I have a problem there pls help ^^
 
[25/06/2010 18:00:33] > Loading firstitems.xml... done.
[25/06/2010 18:00:33] > Loading highscorebook.xml... done.
[25/06/2010 18:00:33] > Loading Monster Quest.xml...[Error - ScriptingManager::loadFromXml] Cannot load mod mods/Monster Ques.xml
[25/06/2010 18:00:33] Line: 1, Info: XML declaration allowed only at the start of the document


[25/06/2010 18:00:33] failed!
[25/06/2010 18:00:33] > 7 mods were loaded.
[25/06/2010 18:00:33] >> Loading map and spawns...


I have a problem there pls help ^^
<...>
wrong:
(space)<?xml version="1.0" encoding="UTF-8"?>
good:
<?xml version="1.0" encoding="UTF-8"?>
 
Can some one make it like when he finsh quest
example after he finsh demon quest he get demonhunter outfit
 
This version for sorcercers only :
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster Quest" version="1.0" author="Damadgerz" contact="[email protected]" enabled="yes">
 <description>
        to add new monster add a comma and add a full line so like this:
		   m = { ["rat"] = {storage = 29000 , kills = 20, item = 7890 ,count = 2 , money = 10000, lvl= 2,look = 21}, 
	      ["wolf"] = {storage = 29010, kills = 500, item = 7890 , count = 2 , money = 10000, lvl = 100 ,look = 27}, 
		  ["spider"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30},   --take care of comma here
		   ["demon"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30}   --here no comma last line
		  }        -storage for monster- how many kills-item to sstart outfit-count of item-money to start quest-lvl required to quest-look type of the monster.                 
		  
		  
		  *in msg just when you add new monster go add it in msg after \nSpider\nDemon\n\n so it be like this:
		  "Monsters in quest:\n!test(monster)\n\nRat\nWolf\nSpider..\nDemon>..\n\n  *To start quest say !start (monster)*\n *!disable: type monster to disable quest to start again item and money will be taken again and kills will be lost*\n*!check (monster) to know how many kills*"
		                                                           without dots
   </description>
	<config name="tutorial_m"><![CDATA[
   m = { ["rat"] = {storage = 29000 , kills = 20, item = 7890 ,count = 2 , money = 10000, lvl= 2,look = 21}, 
	      ["wolf"] = {storage = 29010, kills = 500, item = 7890 , count = 2 , money = 10000, lvl = 100 ,look = 27}, 
		  ["spider"] = {storage = 29020, kills = 400, item = 7890 , count = 2 , money = 10000, lvl = 30, look = 30}
		  }

	 msg = "Monsters in quest :\n\n\nRat\nWolf\nSpider\n\n --------------------------------------\n* !quest : type monster to know requirements\n* !start : type monster name to start quest*\n* !disable : type monster to disable quest (to start again item and money will be taken again and all kills be lost)*\n* !check : type monster to know how many kills*\n* !change : type monster to get the outfit*\n*When complete quest you have to say !disable(monster)*"  
	 storage1 = 2030

 ]]></config>
   <event type="login" name="Tutorial Login" event="script"><![CDATA[
	function onLogin(cid)
		registerCreatureEvent(cid, "test")
	return true
    end

]]></event>
    <event type="kill" name="test" event="script"><![CDATA[
	domodlib('tutorial_m')
	function onKill(cid, target)
	if(isPlayer(target) == TRUE) then
		return TRUE
	end

	local monster = m[string.lower(getCreatureName(target))]
	if(not monster) then
		return TRUE
	end
	if getPlayerStorageValue(cid,monster.storage) >= monster.kills then
     return true
	end
	if getPlayerStorageValue(cid,monster.storage) == -1 or getPlayerStorageValue(cid,storage1) ~= 0 then
	 return true
	end
      setPlayerStorageValue(cid, monster.storage ,(getPlayerStorageValue(cid, monster.storage))+1)
      doSendAnimatedText(getPlayerPosition(cid),""..getPlayerStorageValue(cid, monster.storage).."", math.random(01,255))
	 return true
	end
]]></event>
<talkaction words="!quest" event="script"><![CDATA[
domodlib('tutorial_m')
function onSay(cid, words, param)
monster = m[param]
if isSorcerer(cid) == FALSE then
  doPlayerSendCancel(cid,"Only sorcerers allowed to use this.")
  return true
  end
if (not monster) then
 doPlayerPopupFYI(cid, msg)
return true 
end 
if getPlayerStorageValue(cid,monster.storage) == monster.kills then
     doPlayerPopupFYI(cid, "                          *#Congratulations!#*\n\n\n    You have completed the ["..param.."] quest.\n\n   *Make !change "..param.." to get the outfit when needed*")
	 return true
	 end
   doPlayerPopupFYI(cid,"The ["..param.."] quest requires :\n\n\n *Level : "..monster.lvl.."\n\n*Item : "..getItemNameById(monster.item).."\n     count : " ..monster.count.."\n\n*Money : "..monster.money.." gold coins\n\n*kills : "..monster.kills..".") 
return true
 end



 ]]></talkaction>
 <talkaction words="!start" event="script"><![CDATA[
      domodlib('tutorial_m')
 function onSay(cid, words, param)
  local monster = m[param]
  if isSorcerer(cid) == FALSE then
  doPlayerSendCancel(cid,"Only sorcerers allowed to use this.")
  return true
  end
    if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
        if (not monster and getPlayerStorageValue(cid,storage1) ~= 0 ) then
	        doPlayerSendCancel(cid,"monster dont have quest")
			return true
		elseif (not monster and getPlayerStorageValue(cid,storage1) == 0) then
		   doPlayerSendTextMessage(cid, 19, "You already in quest.")
		   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	     return true
	    end
	    if getPlayerStorageValue(cid,storage1) == 0 then
		  doPlayerSendTextMessage(cid, 19, "You already in quest.")
		  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		 return true
		end
        if getPlayerStorageValue(cid,monster.storage) == monster.kills and (getPlayerLevel(cid) < monster.lvl or getPlayerItemCount(cid, monster.item) < monster.count or getPlayerMoney(cid) < monster.money) then
	      
		  doCreatureSay(cid,"You already completed the "..param.." quest.", TALKTYPE_ORANGE_1)
	   return true
	   end
		if (getPlayerLevel(cid) < monster.lvl or getPlayerItemCount(cid, monster.item) < monster.count or getPlayerMoney(cid) < monster.money) then
		  doPlayerSendCancel(cid,"You dont have the required stuff (press !quest "..param.." to know what needed.")
		  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		  return true
		end
		if getPlayerStorageValue(cid,monster.storage) == monster.kills then
	      
		  doCreatureSay(cid,"You already completed the "..param.." quest.", TALKTYPE_ORANGE_1)
	   return true
	   end
	  doPlayerRemoveMoney(cid, monster.money)
	  doPlayerRemoveItem(cid, monster.item, monster.count)
	  doSendMagicEffect(getPlayerPosition(cid), 27)
	 setPlayerStorageValue(cid, monster.storage ,0)
	  setPlayerStorageValue(cid,storage1,0)
	  doCreatureSay(cid,"You have started "..param.." quest.", TALKTYPE_ORANGE_1)
	 return true 
	end




 ]]></talkaction>
 <talkaction words="!disable" event="script"><![CDATA[
domodlib('tutorial_m')  
  function onSay(cid, words, param)
 
  if isSorcerer(cid) == FALSE then
  doPlayerSendCancel(cid,"Only sorcerers allowed to use this.")
  return true
  end
  local monster = m[param]
  if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end

	 if getPlayerStorageValue(cid,monster.storage) == monster.kills and getPlayerStorageValue(cid,storage1) ~= 0 then

		  doCreatureSay(cid,"You have copmeleted the "..param.." quest.", TALKTYPE_ORANGE_1)
	   return true
	   end
     if getPlayerStorageValue(cid,storage1) ~= 0 then
	   doPlayerSendCancel(cid,"You must start a quest first.")
	   return true
	   end
	   if getPlayerStorageValue(cid,monster.storage) == -1 then
	    doPlayerSendCancel(cid,"You havn't started this monster quest.")
	   return true
	   end
	   if getPlayerStorageValue(cid,monster.storage) == monster.kills then
	      setPlayerStorageValue(cid,storage1,-1)
		  doCreatureSay(cid,"You have copmeleted the "..param.." quest.", TALKTYPE_ORANGE_1)
	   return true
	   end
	 setPlayerStorageValue(cid,storage1,-1)
	 setPlayerStorageValue(cid,monster.storage,-1)
	 doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You have disabled quest.")
	 return true
	 end
	 
  ]]></talkaction>
 
 <talkaction words="!check" event="script"><![CDATA[
 
  domodlib('tutorial_m')
   function onSay(cid, words, param)
   if isSorcerer(cid) == FALSE then
  doPlayerSendCancel(cid,"Only sorcerers allowed to use this.")
  return true
  end
 if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
	monster = m[param]
  if (not monster) then
    doPlayerSendCancel(cid,"Monster not in quest.")
    return true
    end
 if getPlayerStorageValue(cid,monster.storage) < 0 then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "  *Kills : ["..param.."]\n              0/"..monster.kills.."")
  return true
  end
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "  *Kills : ["..param.."]\n              "..getPlayerStorageValue(cid,monster.storage).."/"..monster.kills.."")
  return true
 end
 
  ]]></talkaction>
  
  <talkaction words="!change" event="script"><![CDATA[
   domodlib('tutorial_m')
  function onSay(cid, words, param)
  if isSorcerer(cid) == FALSE then
  doPlayerSendCancel(cid,"Only sorcerers allowed to use this.")
  return true
  end
  
  local monster = m[param]
    if(param == '') then
      doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
     return true
    end
    if(not monster) then
	 doPlayerSendCancel(cid,"Not in quest.")
	 return true
	 end
	 if getPlayerStorageValue(cid,monster.storage) < monster.kills then
	   doPlayerSendCancel(cid,"YOu have to kill "..monster.kills.." "..param.." first.")
	   return true
	   end
     local tmp = getCreatureOutfit(cid)
        tmp.lookType = monster.look
      doCreatureChangeOutfit(cid, tmp)
	  return true
	  end
	  ]]></talkaction>
 </mod>
 
Can some one make it like when he finsh quest
example after he finsh demon quest he get demonhunter outfit

You mean as soon as player complete demon quest the
demon hunter is added to his outfits?
 
Back
Top