• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

C++ !oldmwon or !oldmw off

douglasscherner

New Member
Joined
Aug 15, 2014
Messages
64
Reaction score
3
Hi guys, on my servers there are people who like the old mw sprite and people who like the new sprite.

I saw this talkaction on some servers
!oldmw on
!oldmw off

When it says !oldmw on the client only generates mw with the old id

and

!oldmw off
Returns to current MW which is clearer and more transparent.

Could anyone help?
Thanks
 

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
1,222
Solutions
137
Reaction score
1,512
Location
London
GitHub
MillhioreBT
Twitch
millhiore_bt
YouTube
millhiorebt
TFS 1.4.2+
data/scripts/script.lua
Lua:
local command = "!oldmw"
local storage = 777555

local newMagicWall = Combat()
newMagicWall:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
newMagicWall:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)

local oldMagicWall = Combat()
oldMagicWall:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
oldMagicWall:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_OLD_MAGICWALL)

local rune = Spell(SPELL_RUNE)
function rune.onCastSpell(creature, variant, isHotkey)
    if creature:getStorageValue(storage) == 1 then
        return oldMagicWall:execute(creature, variant)
    end
    return newMagicWall:execute(creature, variant)
end

rune:name("Magic Wall Rune")
rune:group("attack")
rune:runeId(2293)
rune:charges(3)
rune:id(86)
rune:cooldown(2000)
rune:groupCooldown(2000)
rune:level(32)
rune:magicLevel(9)
rune:allowFarUse(true)
rune:isPremium(false)
rune:isBlocking(true, true)
rune:register()

local talkAction = TalkAction(command)

function talkAction.onSay(player, words, param, type)
    local state = param:lower():trim()
    if state == "on" then
        player:setStorageValue(storage, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are now using old magic walls.")
    elseif state == "off" then
        player:setStorageValue(storage, 0)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You are now using new magic walls.")
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Use " .. command .. " on/off")
    end
    return false
end

talkAction:separator(" ")
talkAction:register()
Make sure to configure it, I don't know if it's exactly what you were looking for but at least you have this option available.
 
Top