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

Cast Open (experience)

Kownikuzyt

Member
Joined
Feb 11, 2020
Messages
170
Solutions
1
Reaction score
8
Hello, I searched the forum for a script on !Cast + 20% exp.

I noticed the topic: experience cast open (https://otland.net/threads/experience-cast-open.261391/)

I got 55 exp from a monster and with this script I get 5 exp.

Code: data/talkactions/scripts/cast.lua



Lua:
 storage = 17754

function onSay(player, words, param)
    
if param == 'on' then
        if player:startLiveCast() then
            player:setStorageValue(storage, 1)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have started casting your gameplay.")
        else
            player:sendCancelMessage("You're already casting your gameplay.")
        end
    elseif param == 'off' then
        if player:stopLiveCast() then
            player:setStorageValue(storage, 0)
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have stopped casting your gameplay.")
        else
            player:sendCancelMessage("You're not casting your gameplay.")
        end
    end
    
    return false
end

Code: /home/ots/data/events/scripts/player.lua



Lua:
function Player:onGainExperience(source, exp, rawExp)
     if not source or source:isPlayer() then
         return exp
     end
    
    local multiplier = 1.2
    if player:getStorageValue(17754) == 1 then
        exp = exp * multiplier
    end
 
Solution
@Evil Puncker

Sorry, I misunderstood :(

Code: /home/ots/data/events/scripts/player.lua



Lua:
local multiplier = 1.3
    if print(self:getStorageValue(17754)) == 1 then
        print(exp) = exp * multiplier
    end



Console:

[Warning - Events::load] Can not load script: player.lua
data/events/scripts/player.lua:3: unexpected symbol near '='
Something more like this, so you are printing useful information and know exactly what's happening.
Lua:
local multiplier = 1.3

if self:getStorageValue(17754) == 1 then
    print("have storage")
    exp = exp * multiplier
    print("exp is:" .. exp)
else
    print("dont have storage")
end
I am trying to add EVENTS to my SRC Nostalrius. I spent the night working even without the necessary knowledge, and I confess that I learned a lot. However, I couldn't figure out how to resolve this error. Would you help me? All this would be to add the EXP system to my CAST.

Lua:
/home/job/studio/src/combat.cpp:332:45: error: ‘caster’ was not declared in this scope
  return g_events->eventCreatureOnAreaCombat(caster, tile, aggressive);
                                             ^
/home/job/studio/src/combat.cpp:332:53: error: ‘tile’ was not declared in this scope
  return g_events->eventCreatureOnAreaCombat(caster, tile, aggressive);
                                                     ^
/home/job/studio/src/combat.cpp:332:59: error: ‘aggressive’ was not declared in this scope
  return g_events->eventCreatureOnAreaCombat(caster, tile, aggressive);
                                                           ^
/home/job/studio/src/combat.cpp: In member function ‘bool Combat::setParam(CombatParam_t, uint32_t)’:
/home/job/studio/src/combat.cpp:346:9: warning: enumeration value ‘COMBAT_PARAM_DECREASEDAMAGE’ not handled in switch [-Wswitch]
  switch (param) {
         ^
/home/job/studio/src/combat.cpp:346:9: warning: enumeration value ‘COMBAT_PARAM_MAXIMUMDECREASEDDAMAGE’ not handled in switch [-Wswitch]
CMakeFiles/tfs.dir/build.make:251: recipe for target 'CMakeFiles/tfs.dir/src/combat.cpp.o' failed

Please help me. Thanks <3
 

Attachments

Back
Top