I made a code that champion cannot cast spell such as silened via sys_forbid_magic. But the rune color didn't change with this function, so that I can't recognize whether he/she is silenced immediately.
Could you fix to change rune color when sys_forbid_magic return "true", like set g_disable_runes to "true" for DSB0.60?
Rune color with forbid magic
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
Re: Rune color with forbid magic
Oh...sorry, Sophia. I jumped to conclusions. This problem should be fix by myself and I rewrite a code to fix it inserting g_disable_runes = true or false.
This code what I rewrite is working correctly so far so good. But if this code has some wrong or could be messy, tell me where is wrong.
Code: Select all
function sys_forbid_magic(ppos, who)
local silenced = dsb_get_condition(who, C_SILENCE)
if (silenced) then
for i=1 ,#g_disabled_runes do
g_disabled_runes[i] = true
end
return true
end
for i=1 ,#g_disabled_runes do
g_disabled_runes[i] = false
end
return false
end
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Rune color with forbid magic
That isn't the worst way to do it, though sys_forbid_magic only gets called when you try to actually use magic, so the runes might do strange things visually.
Personally, I'd change the function that drew the runes to check if the character was silenced. You can override draw_rune, found in base/render.lua.
Personally, I'd change the function that drew the runes to check if the character was silenced. You can override draw_rune, found in base/render.lua.