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

Project, United all for the best

Kramer infernal

I work alone =/
Joined
Jun 18, 2008
Messages
225
Reaction score
0
Well, I have this Idea since a long long time ago, but never though the codes to realize it...

there it comes

Player = P
NPC = NPC...

P: Hi
NPC: Be greeted young Player
P: Mission
NPC: I have problems with demons... I really need those out of my thoughts
P: Demons
NPC: Do you want to go to a hunt of demons?
P: Yes
NPC: Then kill for me 1.000 demons and return, I'll give you a reward


After

P: Hi
NPC: Be greeted young Player
P: Mission
NPC: Holy God, thanks for killing them, take, 5 millions of exp and a Demon Helmet for your bravery!

END


Well... I was thinking, the monsters I think you can put scripts to them... So, the think is to create a Function like
Code:
Function onDeathMonster(cid,monster,player,killer)
local area = {x=100, y=100, z=7}
local endarea = {x=160, y=160, z=7}
if corpseofdemon is (area to endarea) and getPlayerStorageValue(cid,storagequest) == 1 then (<-- or some like that, my pc is debugged and I can't access to lua functions)
doPlayerSendTextMessage(cid,22,'You have killed 1 Demon')
end
end

It would some like that, and in demon.xml, you should put script="scriptofdemon.xml"/>

The Idea I think its nice, and it give to Tibia some more of games like Silkroad and so... killing monsters to get a reward :D you will be with me?
 
creatureevents/scripts.login.lua
Code:
registerCreatureEvent(cid, "DemonQuest")
creatureevents.xml
Code:
    <event type="death" name="DemonQuest" script="demonquest.lua"/>
creatureevents/scripts/demonquest.lua
Code:
function onPrepareDeath(cid, killer)
    DEMON_QUEST = getPlayerStorageValue(cid, xxxx)
    if getCreatureName(cid) == "Demon" then
        if DEMON_QUEST ~= 0 and DEMON_QUEST < 1000 then
            setPlayerStorageValue(cid, xxxx, DEMON_QUEST + 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Demons Killed: "..DEMON_QUEST.."/1000.")
        elseif DEMON_QUEST == 1000 then
            doPlayerSendTextMessage(cid, 22, "Congratulations, you are done!")
            setPlayerStorageValue(cid, DEMON_QUEST_DONE, 1)
        end
    end
return TRUE
end

Well, tell me if that works, I tried to make one for myself before but couldnt :(

@ ops, those are creaturescripts, not creatureevents
My Bad :(
 
Last edited:
i changed
function onPrepareDeath(cid, killer)

too
function onDeath(cid, killer)

and i get debugged when i use stuff in the monster. And the script doesn't send the messages to the player... so something is wrong. No error tho...

//Massen
 
creatureevents/scripts.login.lua
Code:
registerCreatureEvent(cid, "DemonQuest")
creatureevents.xml
Code:
    <event type="death" name="DemonQuest" script="demonquest.lua"/>
creatureevents/scripts/demonquest.lua
Code:
function onPrepareDeath(cid, killer)
    DEMON_QUEST = getPlayerStorageValue(cid, xxxx)
    if getCreatureName(cid) == "Demon" then
        if DEMON_QUEST ~= 0 and DEMON_QUEST < 1000 then
            setPlayerStorageValue(cid, xxxx, DEMON_QUEST + 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Demons Killed: "..DEMON_QUEST.."/1000.")
        elseif DEMON_QUEST == 1000 then
            doPlayerSendTextMessage(cid, 22, "Congratulations, you are done!")
            setPlayerStorageValue(cid, DEMON_QUEST_DONE, 1)
        end
    end
return TRUE
end

Well, tell me if that works, I tried to make one for myself before but couldnt :(

@ ops, those are creaturescripts, not creatureevents
My Bad :(

awesome, I like these quest, but do you not think that 1000 demons are pretty much?
 
Something is wrong with this code... is the corpse thing... the script just detect the name of the creature, not if is death <<if isPlayer(killer) == TRUE then... blablabla>> and some like that, am seeing whats the problem so I could solve it but am wayy to sleepy!
 
Back
Top