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

[Idea]Advanced Quests

PharaPL

Learning Lua
Joined
Oct 12, 2008
Messages
43
Reaction score
0
Location
Poland
Heya ;)

Who played on other MMO games?
At much of them is quests for killing mobs, and get some stuffs from beasts...

Its possible to make thats quests in OTS?
Like that:
You talking to NPC, he says you need to klill for example 10 dragons, you killed them and you get reward as exp, money / items, but you can do this quest only 2x or once...

What you think about it? Post it here ;)

Sorry for my bad english, when something is wrong, correct me ;)
 
NPC will have to register event when talking:
Code:
    registerCreatureEvent(cid, "MonsterQuest")

The quest monsters xml file will have to be edited with:
Code:
<script>
    <event name="MonsterQuest"/>
</script>

creaturescripts.xml:
Code:
    <event type="kill" name="MosnterQuest" script="monster quest.lua"/>

and monster quest.lua, something similar to:
Code:
function onKill(cid, target)
    local monster = ""
    if getPlayerStorageValue(cid, storage) < 100 then
        setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
        if getPlayerGlobalStorageValue(cid, storage) == 1 then
            monster = "monster"
        else
            monster = "monsters"
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed "..getPlayerStorageValue(cid, storage).." "..monster..".")
    end
    return TRUE
end
 
NPC will have to register event when talking:
Code:
    registerCreatureEvent(cid, "MonsterQuest")

The quest monsters xml file will have to be edited with:
Code:
<script>
    <event name="MonsterQuest"/>
</script>

creaturescripts.xml:
Code:
    <event type="kill" name="MosnterQuest" script="monster quest.lua"/>

and monster quest.lua, something similar to:
Code:
function onKill(cid, target)
    local monster = ""
    if getPlayerStorageValue(cid, storage) < 100 then
        setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
        if getPlayerGlobalStorageValue(cid, storage) == 1 then
            monster = "monster"
        else
            monster = "monsters"
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed "..getPlayerStorageValue(cid, storage).." "..monster..".")
    end
    return TRUE
end

Why do you add onDeath for monster? Isn't an onKill for players better? :confused:
 
Back
Top