Add player badge and custom message
Posted: 24 Jul 2012, 00:19
Hi, I managed to make Iona, Shield of Emeria display a custom message status for player using badges. If there's a way to add custom player badge then it's much better. Since I cannot find the definition for the player badges except for CONSTANTS.LOL I used prevention icon.
here's a sample screen:
how to make the message is first I made a UI_TEXT0080.XML that contains
then I add static ability for Iona something like this:
Hope this is helpful.
here's a sample screen:
how to make the message is first I made a UI_TEXT0080.XML that contains
- Ident Comment Master Text French Spanish German Italian Japanese Korean Russian Portuguese (Brazil)
PLAYER_SET_IONA_COLOR_1 Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells. Can’t cast white spells.
PLAYER_SET_IONA_COLOR_2 Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells. Can’t cast blue spells.
PLAYER_SET_IONA_COLOR_3 Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells. Can’t cast black spells.
PLAYER_SET_IONA_COLOR_4 Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells. Can’t cast red spells.
PLAYER_SET_IONA_COLOR_5 Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells. Can’t cast green spells.
then I add static ability for Iona something like this:
- Code: Select all
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<CONTINUOUS_ACTION>
local chosencolor = ObjectDC():Get_Int( 0 )
local num_players = MTG():GetNumberOfPlayers()
for i=0,num_players-1 do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player:GetTeam() ~= Object():GetPlayer():GetTeam() then
if chosencolor == 1 then
player:AddBadge(PLAYER_BADGE_ICON_PREVENTION, "PLAYER_SET_IONA_COLOR_1")
end
if chosencolor == 2 then
player:AddBadge(PLAYER_BADGE_ICON_PREVENTION, "PLAYER_SET_IONA_COLOR_2")
end
if chosencolor == 3 then
player:AddBadge(PLAYER_BADGE_ICON_PREVENTION, "PLAYER_SET_IONA_COLOR_3")
end
if chosencolor == 4 then
player:AddBadge(PLAYER_BADGE_ICON_PREVENTION, "PLAYER_SET_IONA_COLOR_4")
end
if chosencolor == 5 then
player:AddBadge(PLAYER_BADGE_ICON_PREVENTION, "PLAYER_SET_IONA_COLOR_5")
end
end
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
Hope this is helpful.