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

CreatureEvent Killing in name of...??? something like that

StreamSide

Joseluis Gonzalez
Staff member
Support Team
Joined
Aug 31, 2007
Messages
3,609
Solutions
51
Reaction score
1,224
Location
Arica - Chile
well, is a old code when i was bored xd
is a noob code but can be usefull for someone D:
sorry for my bad english :O

EDIT: IS IN SPANISH D:


Lua:
function onKill(cid, target)
local pos = getCreaturePosition(cid)
local config = {
    ["Minotaur"] = {
    summonfinal = "The Horned Fox",    
    necesarios = 100,
    efectos = 15,
    valor = 10001,    
    questcompleto = 10002,
    premio = true,
    medalla = true,
    premioid = 1234,
    premioconteo = 1,
    medallaid = 1234
    }
}
    if(isPlayer(target) ~= TRUE) then
        local name = getCreatureName(target)
        local monster = config[string.lower(name)]
        if(monster)then
            if((getPlayerStorageValue(cid, monster.valor) == monster.necesarios-1)and(getPlayerStorageValue(cid, monster.questcompleto) == -1))then
                 doCreatureSay(cid, "Has matado "..monster.necesarios.." "..monster.monstername..". Ahora asesina al "..monster.summonfinal..".", TALKTYPE_ORANGE_1)
                 if((monster.premio) == true)then
                    doPlayerAddItem(cid, monster.premioid, monster.premioconteo)
                    if((monster.medalla) == true)then
                        local medal = doPlayerAddItem(cid,config.wrightablereward,1)
                        doSetItemSpecialDescription(medal, "Esta medalla fue otorgada a "..getPlayerName(cid).." por asesinar "..monster.necesarios.." "..monster.." y ser un verdadero cazador de "..monster..".")
                    end
                end
                setPlayerStorageValue(cid, monster.questcompleto, 1)
                doSendMagicEffect(pos, monster.efecto)
                doCreateMonster(string.lower(monster.summonfinal), pos.x + 1)
            elseif(getPlayerStorageValue(cid, monster.valor) < monster.necesarios-1)then
                setPlayerStorageValue(cid, monster.valor,(getPlayerStorageValue(cid, monster.valor))+1)
                doCreatureSay(cid, "Necesitas matar "..monster.necesarios-(getPlayerStorageValue(cid, monster.valor)).." "..monster.monstername.." para sumonear el "..monster.summonfinal".", TALKTYPE_ORANGE_1)
            end
        end
    end
    return TRUE
end


English Version (Thanks Guitar Freak)
Lua:
  function onKill(cid, target)

        local pos = getCreaturePosition(cid)

        local config = {
                ["Minotaur"] = {
                        finalsummon = "The Horned Fox",    
                        needed = 100,
                        effects = 15,
                        value = 10001,    
                        fullquest = 10002,
                        reward = true,
                        medal = true,
                        rewardid = 1234,
                        rewardcount = 1,
                        medalid = 1234
                }
        }
       
        if(isPlayer(target) ~= TRUE) then
       
                local name = getCreatureName(target)
                local monster = config[string.lower(name)]
               
                if(monster)then
                        if((getPlayerStorageValue(cid, monster.value) == monster.needed-1)and(getPlayerStorageValue(cid, monster.fullquest) == -1))then
                                doCreatureSay(cid, "You have killed "..monster.needed.." "..monster.monstername..". Now kill the "..monster.finalsummon..".", TALKTYPE_ORANGE_1)
                                if((monster.reward) == true)then
                                        doPlayerAddItem(cid, monster.rewardid, monster.rewardcount)
                                        if((monster.medal) == true)then
                                                local medal = doPlayerAddItem(cid,config.medalid,1)
                                                doSetItemSpecialDescription(medal, "This medal was given to "..getCreatureName(cid).." for slaying "..monster.needed.." "..monster.." and be a true "..monster.." hunter.")
                                        end
                                end
                                setPlayerStorageValue(cid, monster.fullquest, 1)
                                doSendMagicEffect(pos, monster.effect)
                                doCreateMonster(string.lower(monster.finalsummon), pos.x + 1)
                        elseif(getPlayerStorageValue(cid, monster.value) < monster.needed-1)then
                                setPlayerStorageValue(cid, monster.value,(getPlayerStorageValue(cid, monster.value))+1)
                                doCreatureSay(cid, "You need to kill "..monster.needed-(getPlayerStorageValue(cid, monster.value)).." "..monster.monstername.." to summon the "..monster.summonfinal".", TALKTYPE_ORANGE_1)
                        end
                end
        end
        return TRUE
end
you can add more than 1 monster :D
 
Last edited:
Translation :thumbup::

Lua:
function onKill(cid, target)

	local pos = getCreaturePosition(cid)

	local config = {
		["Minotaur"] = {
			finalsummon = "The Horned Fox",    
			needed = 100,
			effects = 15,
			value = 10001,    
			fullquest = 10002,
			reward = true,
			medal = true,
			rewardid = 1234,
			rewardcount = 1,
			medalid = 1234
		}
	}
	
	if(isPlayer(target) ~= TRUE) then
	
		local name = getCreatureName(target)
		local monster = config[string.lower(name)]
		
		if(monster)then
			if((getPlayerStorageValue(cid, monster.value) == monster.needed-1)and(getPlayerStorageValue(cid, monster.fullquest) == -1))then
				doCreatureSay(cid, "You have killed "..monster.needed.." "..monster.monstername..". Now kill the "..monster.finalsummon..".", TALKTYPE_ORANGE_1)
				if((monster.reward) == true)then
					doPlayerAddItem(cid, monster.rewardid, monster.rewardcount)
					if((monster.medal) == true)then
						local medal = doPlayerAddItem(cid,config.wrightablereward,1)
						doSetItemSpecialDescription(medal, "This medal was given to "..getCreatureName(cid).." for slaying "..monster.needed.." "..monster.." and be a true "..monster.." hunter.")
					end
				end
				setPlayerStorageValue(cid, monster.fullquest, 1)
				doSendMagicEffect(pos, monster.effect)
				doCreateMonster(string.lower(monster.finalsummon), pos.x + 1)
			elseif(getPlayerStorageValue(cid, monster.value) < monster.needed-1)then
				setPlayerStorageValue(cid, monster.value,(getPlayerStorageValue(cid, monster.value))+1)
				doCreatureSay(cid, "You need to kill "..monster.needed-(getPlayerStorageValue(cid, monster.value)).." "..monster.monstername.." to summon the "..monster.summonfinal".", TALKTYPE_ORANGE_1)
			end
		end
	end
	return TRUE
end

Great script btw, didnt test it but Ill learn some stuff from it.

Only thing is that I think you made a typo on:

Line 31:
Lua:
local medal = doPlayerAddItem(cid,config.wrightablereward,1)

With the "wrightablereward" part thing, I think you ment "medalid" on that part but if not, then I dont understand it..

Good job anyways, +Reppek
 
adding a line
doPlayerAddItem(cid, monster.rewardid, monster.rewardcount
 
I dont understand what this script does ?
..
can some explain ?
 
Last edited:
when you kill x monsters (ex. 10 min) u will gain a storage and for that 10 stor a x monster will be sumoned (ex. horned fox) and you will gain x thing (ex. a medal)

understand?
 
Back
Top