//////////////////////////////////////////////////////////////////////////////////////////////////
// Lobsters Multiboard weapon system\\
// Description: creates a multiboard for a player that describes a units attack, armor, stats,
// attack speed, and evasion, along with allowing you to increase these stats using
// Cohadars bonus system(modified)
//
// Intended Use: This system is intended for rpgs' and other maps that focus on one hero per player
// It is made to replace items as a weapon slot
//
// Requires: vjass
// Importing: Copy the code out of the custom script section,and place
// it in YOUR maps custom script box. Next copy the Bonus, and Bonus Plugins into your map.
// Enable the plugins, and save, close the map, open the map, and disable the plugins.
//
// Demo instructions: Press Esc to create the multiboard. Then type "increase#" where #
// is a number between 1 and 8. You will see your stats in both the hero, and the multiboard
// go up.
//
// Using the system: Using the system is easy. To register a multiboard for a player use the
// function:
//
// function MultiboardCreate takes player p, string wt, string title returns nothing.
//
// player p is the player for whom the mkultiboard will appear
// string wt is the weapon type(or anything else you want to put in the first row)
// string title is the multiboards title.
//
// Use the following functions to increase a heros stats
//
// function updateattack takes unit u, integer i returns nothing
// function updatestrength takes unit u, integer i returns nothing
// function updateagility takes unit u, integer i returns nothing
// function updateintelligence takes unit u, integer i returns nothing
// function updatearmor takes unit u, integer i returns nothing
// function updatespeed takes unit u, integer i returns nothing
// function updatecritical takes unit u, integer i returns nothing
// function updateevasion takes unit u, integer i returns nothing
//
// where unit u is the unit, and integer i is the amount for the respective
// stat.
//
// Special Thanks to: Cohadar for Bonus.
function MultiboardCreate takes player p, string wt, string title returns nothing
globals
//configurables
string attributedamage = "Sharpness"
string attributestrength = "Strength"
string attributeagility = "Agility"
string attributeintelligence= "intelligence"
string attributearmor = "Defense"
string attributespeed = "Speed"
string attributecritical = "Critical"
string attributeevasion = "Evasion"
// end configurables
multiboard array multi
string multititle
integer array damage
integer array strength
integer array agility
integer array intelligence
integer array defense
integer array aspeed
integer array critical
integer array evasion
endglobals
local multiboard m
local integer pli
call BJDebugMsg("test1")
set multi[GetPlayerId(p)] = CreateMultiboard()
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
call MultiboardDisplay(multi[GetPlayerId(p)],false)
call MultiboardSetItemsStyle(m,true, false)
//Now to setup the multiboard
call MultiboardSetColumnCount(m, 1)
call MultiboardSetRowCount(m, 9)
call MultiboardSetItemsWidth(m, .1)
call MultiboardSetTitleText(m, title)
call MultiboardSetItemsStyle(m,true, false)
call MultiboardSetItemValue(MultiboardGetItem(m, 0,0), wt)
call MultiboardSetItemValue(MultiboardGetItem(m, 1,0), attributedamage + ": " +I2S(damage[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 2,0), attributestrength + ": " +I2S(strength[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 3,0), attributeagility + ": " +I2S(agility[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 4,0), attributeintelligence + ": " +I2S(intelligence[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 5,0), attributearmor + ": " +I2S(defense[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 6,0), attributespeed + ": " +I2S(aspeed[pli]))
call MultiboardSetItemValue(MultiboardGetItem(m, 7,0), attributecritical + ": " +I2S(critical[pli])+"%")
call MultiboardSetItemValue(MultiboardGetItem(m, 8,0), attributeevasion + ": " +I2S(evasion[pli])+"%")
if GetLocalPlayer() == p then
call MultiboardDisplay(m,true)
endif
endfunction
function updateattack takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
call BJDebugMsg("lol1")
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Damage[u] = Bonus_Damage[u] + i
set damage[pli] = damage[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,1,0), attributedamage + ": " +I2S(damage[pli]))
endfunction
function updatestrength takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Str[u] = Bonus_Str[u] + i
set strength[pli] = strength[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,2,0), attributestrength + ": " +I2S(strength[pli]))
endfunction
function updateagility takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Agi[u] = Bonus_Agi[u] + i
set agility[pli] = agility[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,3,0), attributeagility + ": " +I2S(agility[pli]))
endfunction
function updateintelligence takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Int[u] = Bonus_Int[u] + i
set intelligence[pli] = intelligence[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,4,0), attributeintelligence + ": " +I2S(intelligence[pli]))
endfunction
function updatearmor takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Armor[u] = Bonus_Armor[u] + i
set defense[pli] = defense[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,5,0), attributearmor + ": " +I2S(defense[pli]))
endfunction
function updatespeed takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_AttackSpeed[u] = Bonus_AttackSpeed[u] + i
set aspeed[pli] = aspeed[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,6,0), attributespeed + ": " +I2S(aspeed[pli]))
endfunction
function updatecritical takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Critical[u] = Bonus_Critical[u] + i
set critical[pli] = critical[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,7,0), attributecritical + ": " +I2S(critical[pli]))
endfunction
function updateevasion takes unit u, integer i returns nothing
local multiboard m
local player p
local integer pli
set p = GetOwningPlayer(u)
set m = multi[GetPlayerId(p)]
set pli = GetPlayerId(p)
set Bonus_Evasion[u] = Bonus_Evasion[u] + i
set evasion[pli] = evasion[pli] + i
call MultiboardSetItemValue(MultiboardGetItem(m,8,0), attributeevasion + ": " +I2S(evasion[pli]))
endfunction