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

Solved ManaShield emblem

Status
Not open for further replies.

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hello, I need some help. Could someone write me a script C++ "When a player has manashield, he gets blue emblem(as during the fight of guild)

Thanks for all :D
 
I'm sorry, I didn't say that is tfs 8.6(0.4) and I don't have the function... :(
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end
 
Hmm, Need Source edit forsure
What you need
1-Edit onEndCondition in Player.cpp to check if(CONDITION_MANASHIELD) Emblem(0)
2-Edit mana shield in spells to add emblem(blue)
3-Edit login.lua to remove emblem(blue) on login :D

you can do it easily if you look around
 
I'm sorry, I didn't say that is tfs 8.6(0.4) and I don't have the function... :(
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end

//doCreatureSetGuildEmblem(cid, emblem)
lua_register(m_luaState, "doCreatureSetGuildEmblem", LuaInterface::luaDoCreatureSetGuildEmblem);

There is no need for a addevent or a source edit. The emblem should dissapear once the player relogs and has no need for an addevent to remove it or to keep it. Tho if you want the manashield to last for however long your ticks are which is 2000 seconds then you need an addevent to remove it. Im positive that the player will re-enable his manashield and thus leaving the addevent to remove it redundant.

My recommendation for you @jestem pro is to make the manashield last forever, and allow the player to disable the mana shield using utamo vis and then set the emblem to be 0, problem solved. no need to overdo it. Simply change the ticks to be 5 hours (1800000) instead of 200000

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
doCreatureSetGuildEmblem(cid, 3)
   return doCombat(cid, combat, var)
end

If you dont have utamo vis, simply copy-paste magic shield and name it disable magic shield and set the ticks to be 0. The new magic shield spell will override the current one and disable it. Remember to edit the guildemblem to be 0 on the new spell
 
Last edited:
I wanted it only as a supplement. Then the player would see if it still has manashield. Of course I'm going to add a item with manashield, but for high level.
 
but is it enough?
Code:
//doCreatureSetGuildEmblem(cid, emblem)
lua_register(m_luaState, "doCreatureSetGuildEmblem", LuaInterface::luaDoCreatureSetGuildEmblem);
 
//doCreatureSetGuildEmblem(cid, emblem)
lua_register(m_luaState, "doCreatureSetGuildEmblem", LuaInterface::luaDoCreatureSetGuildEmblem);

There is no need for a addevent Zothion or a source edit. The emblem should dissapear once the player relogs and has no need for an addevent to remove it or to keep it. Tho if you want the manashield to last for however long your ticks are which is 2000 seconds then you need an addevent to remove it. Im positive that the player will re-enable his manashield and thus leaving the addevent to remove it redundant.

My recommendation for you @jestem pro is to make the manashield last forever, and allow the player to disable the mana shield using utamo vis and then set the emblem to be 0, problem solved. no need to overdo it. Simply change the ticks to be 5 hours (1800000) instead of 200000

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
doCreatureSetGuildEmblem(cid, 3)
   return doCombat(cid, combat, var)
end

If you dont have utamo vis, simply copy-paste magic shield and name it disable magic shield and set the ticks to be 0. The new magic shield spell will override the current one and disable it. Remember to edit the guildemblem to be 0 on the new spell
why would you tag me and say my solution isnt needed, then the next sentence mention the exact case in which my solution would be the easiest? even if they renew it, an addevent is still the easiest way to remove it, just create a new one and cancel old event

i also dont see how 5 hours is "forever", what if a player is on longer than 5 hours? what if a player is on for as long as the server? are you gonna give ppl manashield with 1000000000 tick duration? its way easier to just refresh manashield with a recursive event every now and then if you really want a permanent manashield, or in 0.4, i do believe you can set ticks to -1 for it to be permanent
also, in your example 1800000 isnt even 5 hours, its just a mere 30 minutes, 1800 000 = 1800 seconds = 30 minutes

also why create another spell named utamo vis to disable it? just put it in the same, and if player already has manashield condition add the 0 duration one......
 
why would you tag me and say my solution isnt needed, then the next sentence mention the exact case in which my solution would be the easiest? even if they renew it, an addevent is still the easiest way to remove it, just create a new one and cancel old event

i also dont see how 5 hours is "forever", what if a player is on longer than 5 hours? what if a player is on for as long as the server? are you gonna give ppl manashield with 1000000000 tick duration? its way easier to just refresh manashield with a recursive event every now and then if you really want a permanent manashield, or in 0.4, i do believe you can set ticks to -1 for it to be permanent
also, in your example 1800000 isnt even 5 hours, its just a mere 30 minutes, 1800 000 = 1800 seconds = 30 minutes

also why create another spell named utamo vis to disable it? just put it in the same, and if player already has manashield condition add the 0 duration one......
Yeah you're right about the condition part. I was tired when writing this and thought about it before going to bed.
Either way, I tagged you because you mentioned that there was a addevent required which in my opinion wasnt needed and i wanted your pov on that.
180000 milliseconds is 5 hours. 3600 * 5 = 18000, I miss spelled on my original reply to you and OP :)

Most people die once when 5 hours have passed, or atleast relogs. but if you want to be sure you can do 86400 seconds (86400000 milliseconds) which is 24 hours.
 
Yeah you're right about the condition part. I was tired when writing this and thought about it before going to bed.
Either way, I tagged you because you mentioned that there was a addevent required which in my opinion wasnt needed and i wanted your pov on that.
180000 milliseconds is 5 hours. 3600 * 5 = 18000, I miss spelled on my original reply to you and OP :)

Most people die once when 5 hours have passed, or atleast relogs. but if you want to be sure you can do 86400 seconds (86400000 milliseconds) which is 24 hours.
if you want someones opinion you ask them a question, i dont see where you asked me a question, you just said my suggestion was useless, also read rule 10 of these forums

even with 24 hours, the point still stands, making the condition a set number of ticks can run into issues if server is up for long, and players afk or w/e a lot, rather use a proper solution (infinite ticks which i believe 0.4 has, or just a recursive condition refresh, with new cast cancelling the event and removing the manashield)
 
Status
Not open for further replies.
Back
Top