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

TalkAction Monster For Next Level

tetra20

DD
Joined
Jan 17, 2009
Messages
1,315
Solutions
4
Reaction score
323
Location
Egypt
This is a noobie script i made out of boredom so here it is

Before I Start
-----
Sorry For Horrible Tabbing
This Script Work For Any Monster Not Only Rotworm

-----
For Experience Stage Please Read this
http://otland.net/threads/monster-for-next-level.207536/#post-1989918

A SS
ejs9NS.png

Now The Code
Create a new monster.lua in talkactions/scripts and Paste This

Code:
function onSay(cid, words, param, channel)
local exp = getConfigValue('rateExperience')
    if param == "" then
        doPlayerSendCancel(cid, "Param Needed(For Ex:!exp rotworm)")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        return true
    end
    if not getMonsterInfo(param) then
    doPlayerSendCancel(cid, "Monster Name Is Incorrect")
    return true
    end

    if getExperienceForLevel(getPlayerLevel(cid)+1) > getPlayerExperience(cid) then
        local exped = getExperienceForLevel(getPlayerLevel(cid)+1) - getPlayerExperience(cid)
        local expneed = math.floor(exped / string.lower(getMonsterInfo(param).experience))+1
            doPlayerPopupFYI(cid, "You Need To Kill "..expneed.." "..param.." To Advance To Level "..getPlayerLevel(cid)+1 .."")
    end
    return true
end

And In talkactions.xml Add This
Code:
<talkaction words="!exp" event="script" value="monster.lua"/>

Enjoy
How To Use:
uqZ0Rh.png

Then This Will Appear:
C3bIb6.png


What This Script is Missing:
if the experience rate isn't 1 it will just show normal rate


This Script Should Fix It

Code:
function onSay(cid, words, param, channel)
local exp = getConfigValue('rateExperience')
local time = 60 -- in second
    if param == "" then
        doPlayerSendCancel(cid, "Param Needed(For Ex:!exp rotworm)")
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        return true
    end

    if not getMonsterInfo(param) then
    doPlayerSendCancel(cid, "Monster Name Is Incorrect")
    return true
    end

    if exhaustion.check(cid, 1023) then
    doPlayerSendCancel(cid, "You Need To Wait "..math.floor(exhaustion.get(cid,1023))..".")
    doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        return true
    end

    if getExperienceForLevel(getPlayerLevel(cid)+1) > getPlayerExperience(cid) then
        local exped = getExperienceForLevel(getPlayerLevel(cid)+1) - getPlayerExperience(cid)
        local monsterned = string.lower(getMonsterInfo(param).experience) * exp
        local expneed = math.floor(exped / monsterned)+1
        doPlayerPopupFYI(cid, "You Need To Kill "..expneed.." "..param.." To Advance To Level "..getPlayerLevel(cid)+1 .."")
        exhaustion.set(cid, 1023, time*1000)
        elseif getPlayerExperience(cid) > getExperienceForLevel(getPlayerLevel(cid)+1) then
        local exped2 = getPlayerExperience(cid) - getExperienceForLevel(getPlayerLevel(cid)+1)
        local monsterned2 = string.lower(getMonsterInfo(param).experience) * exp
        local expneed = math.floor(exped2 / monsterned2)+1
        doPlayerPopupFYI(cid,"You Need To Kill "..expneed2.." "..param.." To Advance To Level "..getPlayerLevel(cid)+1 .."")
        exhaustion.set(cid, 1023, time*1000)
    end
    return true
end

Thanks



 
Last edited:
That's fucking nice man. Thanks a lot! I seen something like this WAAAAY back during the 7.6 days. Nice to see someone got it made for up to date and releasing it :D

Madskills bro, madskills
 
I Am Glad You Liked It.I have been searching for it but couldn't find so i made one.if you got any more ideas tell me
 
Also if someone use experience stages, change this:
Code:
local exp = getConfigValue('rateExperience')

to
Code:
local exp =getExperienceStage(getPlayerLevel(cid))
 
Also if someone use experience stages, change this:
Code:
local exp = getConfigValue('rateExperience')

to
Code:
local exp =getExperienceStage(getPlayerLevel(cid))


That will make it work for experience stages forreal?
That's wassup, even not just for players but for someone developing a server before people can play, this talkaction comes in handy bigtime
 
Sidenote for anyone using this, if you do use experience stages, then u need to set the rate in your config for exp to 1.0 so it can read it right, it doesn't read from both the config and the xml file at the same time and then do the math... So it would be off if you had anything different than 1
 
Back
Top