Worldedit
  Worldedit
Le site sur l'éditeur de warcraft 3 !
 
  FAQFAQ   RechercherRechercher   Liste des MembresListe des Membres    Groupes d'utilisateursGroupes d'utilisateurs   medals.php?sid=de8fdc5a814e4fec7ed1163b3a9f4e42Médailles   S'enregistrerS'enregistrer 
 ProfilProfil   Se connecter pour vérifier ses messages privésSe connecter pour vérifier ses messages privés   ConnexionConnexion 
  FAQFAQ World Editor   UploadUploader une map ou une image    UploadAjouter sa map à l'annuaire   UploadConsulter l'annuaire

Weu ajoute du jass... qui sert a quoi?

 
Poster un nouveau sujet   Répondre au sujet    Worldedit Index du Forum -> Autre
Voir le sujet précédent :: Voir le sujet suivant  
Auteur Message
 DaKanibal
Membre a fort taux de post


Inscrit le: 12 Sep 2009
Messages: 801
Sujets: 64
Spécialité en worldedit: Ne pas.


MessagePosté le: 12/07/10 21:48    Sujet du message: Weu ajoute du jass... qui sert a quoi? Citer

Bonjour à tous,

J'ai récemment téléchargé WEU, donc je créer une map avec mais là, il y a un visiteur :

Secret:

[Jass:1:dd58382603]function GetLength takes string B returns integer
local integer L
if B == "" then
return 0
endif
set L = 1
loop
exitwhen SubStringBJ(B,L,L) == ""
set L = L + 1
endloop
return L - 1
endfunction
function CamSetPid takes nothing returns nothing
set udg_zz_CamPid[udg_zz_CamPidIndex] = GetPlayerId(GetEnumPlayer())
set udg_zz_CamPidIndex = udg_zz_CamPidIndex + 1
endfunction
function Abilcode2Heroskillcode takes integer I returns integer
return I
endfunction
function SetUnitIndex takes nothing returns integer
set udg_zz_UnitIndex = udg_zz_UnitIndex + 1
return udg_zz_UnitIndex
endfunction
function InArrayGebenEinheit takes unit Hinzu returns nothing
set udg_zz_AllUnits[SetUnitIndex()] = Hinzu
endfunction
function GetUniqueEinheitsnummer takes unit U returns integer
local integer Index = 1
local integer Id = udg_zz_UnitIndex + 1
local integer Free = -1
loop
exitwhen Index > udg_zz_UnitIndex
if udg_zz_AllUnits[Index] == null then
set Free = Index
endif
if udg_zz_AllUnits[Index] == U then
set Id = Index
set Index = udg_zz_UnitIndex + 1
else
set Index = Index + 1
endif
endloop
if Id == udg_zz_UnitIndex + 1 then
if Free != -1 then
set udg_zz_AllUnits[Free] = U
return Free
endif
call InArrayGebenEinheit(U)
endif
return Id
endfunction
function returnubersplat takes ubersplat a returns ubersplat
return a
endfunction
function returnimage takes image a returns image
return a
endfunction
function returnlightning takes lightning a returns lightning
return a
endfunction
function returntrackable takes trackable a returns trackable
return a
endfunction
function returnabilcode takes integer a returns integer
return a
endfunction
function returnboolean takes boolean a returns boolean
return a
endfunction
function returndestructable takes destructable a returns destructable
return a
endfunction
function returndestructablecode takes integer a returns integer
return a
endfunction
function returndialog takes dialog a returns dialog
return a
endfunction
function returnbutton takes button a returns button
return a
endfunction
function returneventid takes eventid a returns eventid
return a
endfunction
function returntexttag takes texttag a returns texttag
return a
endfunction
function returninteger takes integer a returns integer
return a
endfunction
function returnitem takes item a returns item
return a
endfunction
function returnitemcode takes integer a returns integer
return a
endfunction
function returnleaderboard takes leaderboard a returns leaderboard
return a
endfunction
function returnmultiboard takes multiboard a returns multiboard
return a
endfunction
function returnmultiboarditem takes multiboarditem a returns multiboarditem
return a
endfunction
function returnordercode takes integer a returns integer
return a
endfunction
function returnplayer takes player a returns player
return a
endfunction
function returnforce takes force a returns force
return a
endfunction
function returnlocation takes location a returns location
return a
endfunction
function returnreal takes real a returns real
return a
endfunction
function returnrect takes rect a returns rect
return a
endfunction
function returnregion takes region a returns region
return a
endfunction
function returneffect takes effect a returns effect
return a
endfunction
function returnstring takes string a returns string
return a
endfunction
function returnterraindeformation takes terraindeformation a returns terraindeformation
return a
endfunction
function returntimer takes timer a returns timer
return a
endfunction
function returntimerdialog takes timerdialog a returns timerdialog
return a
endfunction
function returntrigger takes trigger a returns trigger
return a
endfunction
function returntriggeraction takes triggeraction a returns triggeraction
return a
endfunction
function returntriggercondition takes triggercondition a returns triggercondition
return a
endfunction
function returnunit takes unit a returns unit
return a
endfunction
function returngroup takes group a returns group
return a
endfunction
function returnunitcode takes integer a returns integer
return a
endfunction
function returnmusicfile takes string a returns string
return a
endfunction
function returnheroskillcode takes integer a returns integer
return a
endfunction
function WEUCache takes nothing returns gamecache
return InitGameCache("WEU.w3v")
endfunction
function Rect2Unit takes rect R returns unit
return R
return null
endfunction
function Unit2Rect takes unit U returns rect
return U
return null
endfunction
function Loc2Unit takes location L returns unit
return L
return null
endfunction
function Unit2Loc takes unit U returns location
return U
return null
endfunction
function Handle2Int takes handle H returns integer
if H != null then
return H
endif
return 0
endfunction
function Boo2Int takes boolean B returns integer
if B then
return 1
endif
return 0
endfunction
function Real2Int takes real R returns integer
if R != 0 then
return R
endif
return 0
endfunction
function Str2Int takes string S returns integer
if S != "" then
return S
endif
return 0
endfunction
function Int2Unit takes integer I returns unit
if I != 0 then
return I
endif
return null
endfunction
function Int2Item takes integer I returns item
if I != 0 then
return I
endif
return null
endfunction
function Int2Dest takes integer I returns destructable
if I != 0 then
return I
endif
return null
endfunction
function Int2Track takes integer I returns trackable
if I != 0 then
return I
endif
return null
endfunction
function Int2Player takes integer I returns player
if I != 0 then
return I
endif
return null
endfunction
function Int2Force takes integer I returns force
if I != 0 then
return I
endif
return null
endfunction
function Int2Group takes integer I returns group
if I != 0 then
return I
endif
return null
endfunction
function Int2Trigger takes integer I returns trigger
if I != 0 then
return I
endif
return null
endfunction
function Int2Loc takes integer I returns location
if I != 0 then
return I
endif
return null
endfunction
function Int2Region takes integer I returns region
if I != 0 then
return I
endif
return null
endfunction
function Int2Rect takes integer I returns rect
if I != 0 then
return I
endif
return null
endfunction
function Int2Sound takes integer I returns sound
if I != 0 then
return I
endif
return null
endfunction
function Int2Effect takes integer I returns effect
if I != 0 then
return I
endif
return null
endfunction
function Int2Dialog takes integer I returns dialog
if I != 0 then
return I
endif
return null
endfunction
function Int2Button takes integer I returns button
if I != 0 then
return I
endif
return null
endfunction
function Int2Quest takes integer I returns quest
if I != 0 then
return I
endif
return null
endfunction
function Int2Timer takes integer I returns timer
if I != 0 then
return I
endif
return null
endfunction
function Int2Lboard takes integer I returns leaderboard
if I != 0 then
return I
endif
return null
endfunction
function Int2Mboard takes integer I returns multiboard
if I != 0 then
return I
endif
return null
endfunction
function Int2Texttag takes integer I returns texttag
if I != 0 then
return I
endif
return null
endfunction
function Int2Boo takes integer I returns boolean
if I != 0 then
return true
endif
return false
endfunction
function Int2Real takes integer I returns real
if I != 0 then
return I
endif
return 0.00
endfunction
function Int2Str takes integer I returns string
if I != 0 then
return I
endif
return ""
endfunction
function CinematicModeExBJAdvanced takes boolean cineMode, force forForce, real interfaceFadeTime returns nothing
local integer Index = 0
set udg_zz_CamPidIndex = 0
call ForForce(forForce,function CamSetPid)
if (not bj_gameStarted) then
set interfaceFadeTime = 0
endif
if (cineMode) then
if (not bj_cineModeAlreadyIn) then
set bj_cineModeAlreadyIn = true
set bj_cineModePriorFogSetting = IsFogEnabled()
set bj_cineModePriorMaskSetting = IsFogMaskEnabled()
set bj_cineModePriorDawnDusk = IsDawnDuskEnabled()
loop
exitwhen Index == udg_zz_CamPidIndex
if udg_zz_AdjustCam[udg_zz_CamPid[Index]] == false then
set udg_zz_CamAlreadyOff[udg_zz_CamPid[Index]] = true
endif
set Index = Index + 1
endloop
endif
set Index = 0
loop
exitwhen Index == udg_zz_CamPidIndex
set udg_zz_AdjustCam[udg_zz_CamPid[Index]] = false
set Index = Index + 1
endloop
if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
call ClearTextMessages()
call ShowInterface(false, interfaceFadeTime)
call EnableUserControl(false)
call EnableOcclusion(false)
call FogMaskEnable(false)
call FogEnable(false)
call EnableWorldFogBoundary(false)
call EnableDawnDusk(false)
call SetCineModeVolumeGroupsBJ()
endif
else
set bj_cineModeAlreadyIn = false
set Index = 0
loop
exitwhen Index == udg_zz_CamPidIndex
if udg_zz_CamAlreadyOff[udg_zz_CamPid[Index]] == true then
set udg_zz_CamAlreadyOff[udg_zz_CamPid[Index]] = false
else
set udg_zz_AdjustCam[udg_zz_CamPid[Index]] = true
set udg_zz_CamAlreadyOff[udg_zz_CamPid[Index]] = false
endif
set Index = Index + 1
endloop
if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
call ShowInterface(true, interfaceFadeTime)
call EnableUserControl(true)
call EnableOcclusion(true)
call FogMaskEnable(bj_cineModePriorMaskSetting)
call FogEnable(bj_cineModePriorFogSetting)
call EnableWorldFogBoundary(true)
call EnableDawnDusk(bj_cineModePriorDawnDusk)
call VolumeGroupReset()
call EndThematicMusic()
call CameraResetSmoothingFactorBJ()
endif
endif
endfunction
function CinematicModeBJAdvanced takes boolean cineMode, player P, real FadeTime returns nothing
local force F = CreateForce()
call ForceAddPlayer(F,P)
call CinematicModeExBJAdvanced(cineMode,F,FadeTime)
set F = null
endfunction
function ErrorMsg takes player ForPlayer, string Msg returns nothing
local sound Error = CreateSound("Sound\\Interface\\Error.wav", false, false, false, 10, 10,"HeroAcksEAX")
if (GetLocalPlayer() == ForPlayer) then
call ClearTextMessages()
call DisplayTimedTextToPlayer(ForPlayer,0.52,-1.00,2.00,"|cffffcc00"+Msg+"|r")
call SetSoundParamsFromLabel(Error,"InterfaceError")
call SetSoundDuration(Error,614)
call SetSoundChannel(Error,6)
call PlaySoundBJ(Error)
endif
endfunction
function InitShortcuts takes nothing returns nothing
set udg_zz_ShortcutId[32] = "Leertaste"
set udg_zz_ShortcutId[48] = "0"
set udg_zz_ShortcutId[49] = "1"
set udg_zz_ShortcutId[50] = "2"
set udg_zz_ShortcutId[51] = "3"
set udg_zz_ShortcutId[52] = "4"
set udg_zz_ShortcutId[53] = "5"
set udg_zz_ShortcutId[54] = "6"
set udg_zz_ShortcutId[55] = "7"
set udg_zz_ShortcutId[56] = "8"
set udg_zz_ShortcutId[57] = "9"
set udg_zz_ShortcutId[65] = "A"
set udg_zz_ShortcutId[66] = "B"
set udg_zz_ShortcutId[67] = "C"
set udg_zz_ShortcutId[68] = "D"
set udg_zz_ShortcutId[69] = "E"
set udg_zz_ShortcutId[70] = "F"
set udg_zz_ShortcutId[71] = "G"
set udg_zz_ShortcutId[72] = "H"
set udg_zz_ShortcutId[73] = "I"
set udg_zz_ShortcutId[74] = "J"
set udg_zz_ShortcutId[75] = "K"
set udg_zz_ShortcutId[76] = "L"
set udg_zz_ShortcutId[77] = "M"
set udg_zz_ShortcutId[78] = "N"
set udg_zz_ShortcutId[79] = "O"
set udg_zz_ShortcutId[80] = "P"
set udg_zz_ShortcutId[81] = "Q"
set udg_zz_ShortcutId[82] = "R"
set udg_zz_ShortcutId[83] = "S"
set udg_zz_ShortcutId[84] = "T"
set udg_zz_ShortcutId[85] = "U"
set udg_zz_ShortcutId[86] = "V"
set udg_zz_ShortcutId[87] = "W"
set udg_zz_ShortcutId[88] = "X"
set udg_zz_ShortcutId[89] = "Y"
set udg_zz_ShortcutId[90] = "Z"
set udg_zz_ShortcutId[96] = "Numpad0"
set udg_zz_ShortcutId[97] = "Numpad1"
set udg_zz_ShortcutId[98] = "Numpad2"
set udg_zz_ShortcutId[99] = "Numpad3"
set udg_zz_ShortcutId[100] = "Numpad4"
set udg_zz_ShortcutId[101] = "Numpad5"
set udg_zz_ShortcutId[102] = "Numpad6"
set udg_zz_ShortcutId[103] = "Numpad7"
set udg_zz_ShortcutId[104] = "Numpad8"
set udg_zz_ShortcutId[105] = "Numpad9"
set udg_zz_ShortcutId[512] = "Escape"
endfunction
function Klickaktionen takes nothing returns nothing
local integer Index = GetPlayerId(GetTriggerPlayer()) * 12
call DialogDisplayBJ(false,udg_zz_DialogSpieler[GetPlayerId(GetTriggerPlayer())],GetTriggerPlayer())
loop
set udg_zz_DialogShortcut[Index] = 0
exitwhen Index == (GetPlayerId(GetTriggerPlayer()) * 12) + 11
set Index = Index + 1
endloop
set Index = 0
loop
exitwhen GetClickedButtonBJ() == udg_zz_DialogButton[Index]
set Index = Index + 1
endloop
set udg_zz_LastClickedButtonNr[GetPlayerId(GetTriggerPlayer())] = Index + 1 - GetPlayerId(GetTriggerPlayer()) * 12
call ExecuteFunc(udg_zz_DialogAktion[Index])
endfunction
function GetLastClickedDialogButtonNrOfPlayer takes player P returns integer
return udg_zz_LastClickedButtonNr[GetPlayerId(P)]
endfunction
function Dialoginitialisierung takes nothing returns nothing
local integer Index = 0
loop
set udg_zz_DialogSpieler[Index] = DialogCreate()
exitwhen Index == 11
set Index = Index + 1
endloop
set Index = 0
loop
set udg_zz_DialogAktion[Index] = ""
set udg_zz_DialogFolge[Index] = CreateTrigger()
call TriggerRegisterDialogEventBJ(udg_zz_DialogFolge[Index],udg_zz_DialogSpieler[Index])
call TriggerAddAction(udg_zz_DialogFolge[Index],function Klickaktionen)
exitwhen Index == 11
set Index = Index + 1
endloop
call InitShortcuts()
endfunction
function ButtonHinzu takes string B, string F, string FarbeText, integer Spieler, integer Arrayposition, integer Index returns integer
if B != "" then
call DialogAddButtonBJ(udg_zz_DialogSpieler[Spieler],"|cff" + FarbeText + B + "|r")
if F == "" then
set udg_zz_DialogAktion[Arrayposition + Index] = "DoNothing"
else
set udg_zz_DialogAktion[Arrayposition + Index] = F
endif
set udg_zz_DialogButton[Arrayposition + Index] = GetLastCreatedButtonBJ()
endif
set Index = Index + 1
return Index
endfunction
function DialogOhneShortcut takes player Spieler, string Label, string FarbeLabel, string FarbeText, string B1, string F1, string B2, string F2, string B3, string F3, string B4, string F4, string B5, string F5, string B6, string F6, boolean Show returns nothing
local integer Arrayposition = GetPlayerId(Spieler) * 12
local integer Index = 0
call DialogClearBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)])
call DialogSetMessageBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)],"|cff" + FarbeLabel + Label + "|r")
set Index = ButtonHinzu(B1,F1,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B2,F2,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B3,F3,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B4,F4,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B5,F5,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B6,F6,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
if Show == true then
call DialogDisplayBJ(true,udg_zz_DialogSpieler[GetPlayerId(Spieler)],Spieler)
endif
endfunction
function AddButtonsOhneShortcut takes player Spieler, string FarbeText, string B7, string F7, string B8, string F8, string B9, string F9, string B10, string F10, string B11, string F11, string B12, string F12 returns nothing
local integer Arrayposition = GetPlayerId(Spieler) * 12
local integer Index = 6
set Index = ButtonHinzu(B7,F7,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B8,F8,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B9,F9,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B10,F10,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B11,F11,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonHinzu(B12,F12,FarbeText,GetPlayerId(Spieler),Arrayposition,Index)
call DialogDisplayBJ(true,udg_zz_DialogSpieler[GetPlayerId(Spieler)],Spieler)
endfunction
function UcaseWord takes string S returns string
if S == "a" then
return "A"
elseif S == "b" then
return "B"
elseif S == "c" then
return "C"
elseif S == "d" then
return "D"
elseif S == "e" then
return "E"
elseif S == "f" then
return "F"
elseif S == "g" then
return "G"
elseif S == "h" then
return "H"
elseif S == "i" then
return "I"
elseif S == "j" then
return "J"
elseif S == "k" then
return "K"
elseif S == "l" then
return "L"
elseif S == "m" then
return "M"
elseif S == "n" then
return "N"
elseif S == "o" then
return "O"
elseif S == "p" then
return "P"
elseif S == "q" then
return "Q"
elseif S == "r" then
return "R"
endif
if S == "s" then
return "S"
elseif S == "t" then
return "T"
elseif S == "u" then
return "U"
elseif S == "v" then
return "V"
elseif S == "w" then
return "W"
elseif S == "x" then
return "X"
elseif S == "y" then
return "Y"
elseif S == "z" then
return "Z"
endif
return S
endfunction
function LcaseWord takes string S returns string
if S == "A" then
return "a"
elseif S == "B" then
return "b"
elseif S == "C" then
return "c"
elseif S == "D" then
return "d"
elseif S == "E" then
return "e"
elseif S == "F" then
return "f"
elseif S == "G" then
return "g"
elseif S == "H" then
return "h"
elseif S == "I" then
return "i"
elseif S == "J" then
return "j"
elseif S == "K" then
return "k"
elseif S == "L" then
return "l"
elseif S == "M" then
return "m"
elseif S == "N" then
return "n"
elseif S == "O" then
return "o"
elseif S == "P" then
return "p"
elseif S == "Q" then
return "q"
elseif S == "R" then
return "r"
endif
if S == "S" then
return "s"
elseif S == "T" then
return "t"
elseif S == "U" then
return "u"
elseif S == "V" then
return "v"
elseif S == "W" then
return "w"
elseif S == "X" then
return "x"
elseif S == "Y" then
return "y"
elseif S == "Z" then
return "z"
endif
return S
endfunction
function Uppercase takes string S returns string
local integer L = GetLength(S)
local integer Index = 1
local string Ret = ""
loop
set Ret = Ret + UcaseWord(SubStringBJ(S,Index,Index))
exitwhen Index == L
set Index = Index + 1
endloop
return Ret
endfunction
function Lowercase takes string S returns string
local integer L = GetLength(S)
local integer Index = 1
local string Ret = ""
loop
set Ret = Ret + LcaseWord(SubStringBJ(S,Index,Index))
exitwhen Index == L
set Index = Index + 1
endloop
return Ret
endfunction
function CountWords takes string ChatMsg returns integer
local integer Anzahl = 1
local integer Length = GetLength(ChatMsg)
local integer Index = 1
loop
if SubStringBJ(ChatMsg,Index,Index) == " " then
if Index != 1 and Index != Length then
set Anzahl = Anzahl + 1
endif
endif
exitwhen Index == Length
set Index = Index + 1
endloop
return Anzahl
endfunction
function ColoredString takes string Bright, string Color, string Text returns string
return "|c" + Bright + Color + Text + "|r"
endfunction
function WordParser takes string ChatMsg, integer Word returns string
local string array Chkstr
local integer Last = 0
local integer A = 1
local integer I = 0
local integer Length = GetLength(ChatMsg)
loop
if(SubStringBJ(ChatMsg,A,A) == " ") then
if A != 1 and A != Length then
set Chkstr[I] = SubStringBJ(ChatMsg,(Last + 1),(A - 1))
set Last = A
set I = I + 1
endif
elseif(A == Length) then
set Chkstr[I] = SubStringBJ(ChatMsg,(Last + 1),A)
endif
set A = A + 1
exitwhen A > Length
exitwhen Word + 1 == I
endloop
return Chkstr[Word]
endfunction
function ShortcutNochNichtVerwendet takes integer Cut, integer Position returns boolean
local integer Index = Position
loop
exitwhen Index == Position + 13
exitwhen udg_zz_DialogShortcut[Index] == Cut
set Index = Index + 1
endloop
if udg_zz_DialogShortcut[Index] == Cut then
return false
endif
return true
endfunction
function StelleImString takes string B, string Teil returns integer
local integer Stelle = 1
set Teil = Uppercase(SubStringBJ(Teil,1,1))
loop
exitwhen SubStringBJ(B,Stelle,Stelle) == ""
exitwhen SubStringBJ(B,Stelle,Stelle) == Teil
set Stelle = Stelle + 1
endloop
if SubStringBJ(B,Stelle,Stelle) == Teil then
return Stelle
else
set Stelle = 1
set Teil = Lowercase(Teil)
loop
exitwhen SubStringBJ(B,Stelle,Stelle) == ""
exitwhen SubStringBJ(B,Stelle,Stelle) == Teil
set Stelle = Stelle + 1
endloop
if SubStringBJ(B,Stelle,Stelle) == Teil then
return Stelle
endif
endif
return 0
endfunction
function KeinShortcut takes string B, string FarbeText, string FarbeCut, integer Position, integer Additiv returns string
local integer Stelle = 1
local string Buchstabe
local integer Index = 48
local integer Ende = GetLength(B)
loop
set Buchstabe = Uppercase(SubStringBJ(B,Stelle,Stelle))
loop
exitwhen Index == 91
exitwhen Buchstabe == ""
exitwhen Buchstabe == udg_zz_ShortcutId[Index]
set Index = Index + 1
endloop
if Buchstabe == "" then
set udg_zz_DialogShortcut[Position + Additiv] = 0
return "|cff" + FarbeText + B + "|r"
elseif Index == 91 then
set Stelle = Stelle + 1
elseif Index <= 90 then
if ShortcutNochNichtVerwendet(Index,Position) == true then
set udg_zz_DialogShortcut[Position + Additiv] = Index
if Stelle != 1 then
if Stelle == Ende then
return "|cff" + FarbeText + SubStringBJ(B,1,Stelle - 1) + "|cff" + FarbeCut + SubStringBJ(B,Stelle,Stelle) + "|r"
else
return "|cff" + FarbeText + SubStringBJ(B,1,Stelle - 1) + "|cff" + FarbeCut + SubStringBJ(B,Stelle,Stelle) + "|r|cff" + FarbeText + SubStringBJ(B,Stelle + 1,Ende) + "|r"
endif
else
return "|cff" + FarbeCut + SubStringBJ(B,1,1) + "|r|cff" + FarbeText + SubStringBJ(B,2,Ende) + "|r"
endif
endif
set Stelle = Stelle + 1
endif
set Index = 48
endloop
return B
endfunction
function VerarbeiteString takes string B, integer C, string FarbeText, string FarbeCut, integer Position, integer Additiv returns string
local integer Stelle = 1
local string Buchstabe
local integer Index = 48
local integer Ende = GetLength(B)
if C == 0 then
return KeinShortcut(B,FarbeText,FarbeCut,Position,Additiv)
else
if ShortcutNochNichtVerwendet(C,Position) == true then
set Stelle = StelleImString(B,udg_zz_ShortcutId[C])
set udg_zz_DialogShortcut[Position + Additiv] = C
if Stelle == 0 then
return "|cff" + FarbeText + B + " (|r|cff" + FarbeCut + udg_zz_ShortcutId[C] + "|r|cff" + FarbeText + ")|r"
elseif Stelle == 1 then
return "|cff" + FarbeCut + SubStringBJ(B,1,1) + "|r|cff" + FarbeText + SubStringBJ(B,2,Ende) + "|r"
else
return "|cff" + FarbeText + SubStringBJ(B,1,Stelle - 1) + "|r|cff" + FarbeCut + SubStringBJ(B,Stelle,Stelle) + "|r|cff" + FarbeText + SubStringBJ(B,Stelle + 1,Ende) + "|r"
endif
else
return KeinShortcut(B,FarbeText,FarbeCut,Position,Additiv)
endif
endif
return B
endfunction
function ButtonMitShortcutHinzu takes string B, string F, integer C, string FarbeText, string FarbeShortcut, integer Spieler, integer Arrayposition, integer Index returns integer
if B != "" then
set B = VerarbeiteString(B,C,FarbeText,FarbeShortcut,Arrayposition,Index)
call DialogAddButtonWithHotkeyBJ(udg_zz_DialogSpieler[Spieler],B,udg_zz_DialogShortcut[Arrayposition + Index])
if F == "" then
set udg_zz_DialogAktion[Arrayposition + Index] = "DoNothing"
else
set udg_zz_DialogAktion[Arrayposition + Index] = F
endif
set udg_zz_DialogButton[Arrayposition + Index] = GetLastCreatedButtonBJ()
endif
set Index = Index + 1
return Index
endfunction
function InfoDialogMitShortcut takes player Spieler, string Label, string FarbeText, string FarbeShortcut, string B1, string F1, integer C1, string B2, string F2, integer C2, string B3, string F3, integer C3, string B4, string F4, integer C4, string B5, string F5, integer C5, string B6, string F6, integer C6 returns nothing
local integer Arrayposition = GetPlayerId(Spieler) * 12
local integer Index = 0
call DialogClearBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)])
call DialogSetMessageBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)],Label)
set Index = ButtonMitShortcutHinzu(B1,F1,C1,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B2,F2,C2,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B3,F3,C3,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B4,F4,C4,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B5,F5,C5,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B6,F6,C6,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
call DialogDisplayBJ(true,udg_zz_DialogSpieler[GetPlayerId(Spieler)],Spieler)
endfunction
function DialogMitShortcut takes player Spieler, string Label, string FarbeLabel, string FarbeText, string FarbeShortcut, string B1, string F1, integer C1, string B2, string F2, integer C2, string B3, string F3, integer C3, string B4, string F4, integer C4, string B5, string F5, integer C5, string B6, string F6, integer C6, boolean Show returns nothing
local integer Arrayposition = GetPlayerId(Spieler) * 12
local integer Index = 0
call DialogClearBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)])
call DialogSetMessageBJ(udg_zz_DialogSpieler[GetPlayerId(Spieler)],"|cff" + FarbeLabel + Label + "|r")
set Index = ButtonMitShortcutHinzu(B1,F1,C1,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B2,F2,C2,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B3,F3,C3,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B4,F4,C4,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B5,F5,C5,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B6,F6,C6,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
if Show == true then
call DialogDisplayBJ(true,udg_zz_DialogSpieler[GetPlayerId(Spieler)],Spieler)
endif
endfunction
function AddButtonsMitShortcut takes player Spieler, string FarbeText, string FarbeShortcut, string B7, string F7, integer C7, string B8, string F8, integer C8, string B9, string F9, integer C9, string B10, string F10, integer C10, string B11, string F11, integer C11, string B12, string F12, integer C12 returns nothing
local integer Arrayposition = GetPlayerId(Spieler) * 12
local integer Index = 6
set Index = ButtonMitShortcutHinzu(B7,F7,C7,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B8,F8,C8,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B9,F9,C9,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B10,F10,C10,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B11,F11,C11,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
set Index = ButtonMitShortcutHinzu(B12,F12,C12,FarbeText,FarbeShortcut,GetPlayerId(Spieler),Arrayposition,Index)
call DialogDisplayBJ(true,udg_zz_DialogSpieler[GetPlayerId(Spieler)],Spieler)
endfunction
function TertiaryStringOp takes boolean expr, string a, string b returns string
if (expr) then
return a
else
return b
endif
return b
endfunction
function DebugIdInteger2IdString takes integer value returns string
local string charMap = "..................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."
local string result = ""
local integer remainingValue = value
local integer charValue
local integer byteno
set byteno = 0
loop
set charValue = ModuloInteger(remainingValue, 256)
set remainingValue = remainingValue / 256
set result = SubString(charMap, charValue, charValue + 1) + result
set byteno = byteno + 1
exitwhen byteno == 4
endloop
return result
endfunction
function IdString2DebugIdInteger takes string value returns integer
local string charMap = "..................................!.#$%&'()*+,-./0123456789:;<=>.@ABCDEFGHIJKLMNOPQRSTUVWXYZ[.]^_`abcdefghijklmnopqrstuvwxyz{|}~................................................................................................................................."
local integer Index = 1
local string CheckChar
local integer Ergebnis = 0
local integer Mod = 0
set CheckChar = SubStringBJ(value,1,1)
loop
exitwhen CheckChar == SubStringBJ(charMap,Index,Index)
set Index = Index + 1
endloop
set Ergebnis = (Index - 1) * 256
set CheckChar = SubStringBJ(value,2,2)
set Index = 1
loop
exitwhen CheckChar == SubStringBJ(charMap,Index,Index)
set Index = Index + 1
endloop
set Ergebnis = Ergebnis + Index - 1
set Ergebnis = Ergebnis * 256
set CheckChar = SubStringBJ(value,3,3)
set Index = 1
loop
exitwhen CheckChar == SubStringBJ(charMap,Index,Index)
set Index = Index + 1
endloop
set Ergebnis = Ergebnis + Index - 1
set Ergebnis = Ergebnis * 256
set CheckChar = SubStringBJ(value,4,4)
set Index = 1
loop
exitwhen CheckChar == SubStringBJ(charMap,Index,Index)
set Index = Index + 1
endloop
set Ergebnis = Ergebnis + Index - 1
return Ergebnis
endfunction
function Integer2HeroSpellId takes string S returns integer
return IdString2DebugIdInteger(S)
endfunction
function JoinAttachPoints takes string S, string S2 returns string
return S + S2
endfunction
function AssembleCode takes string S returns string
local integer L = GetLength(S)
local integer Rows = R2I(L / 5)
local integer Mod
local integer Lines
local string array New
local string Ret = ""
local integer Index = 1
local integer Zaehler = 0
local integer Dimension = 1
if Rows > 20 then
set Rows = 20
elseif Rows == 0 then
set Rows = 1
endif
set Mod = ModuloInteger(L,Rows)
set Lines = (L - Mod) / Rows
loop
exitwhen Index > L
set New[udg_zz_CodeRows[Zaehler] + Dimension * 20] = SubStringBJ(S,Index,Index)
set Index = Index + 1
set Zaehler = Zaehler + 1
if Zaehler >= Rows then
set Zaehler = Zaehler - Rows
set Dimension = Dimension + 1
endif
endloop
set Index = 0
loop
exitwhen GetLength(Ret) >= L
if Index < Mod then
set Ret = Ret + New[udg_zz_CodeRows[Index] + (Lines + 1) * 20]
endif
set Dimension = 1
loop
exitwhen Dimension > Lines
set Ret = Ret + New[udg_zz_CodeRows[Index] + (Lines - Dimension + 1) * 20]
set Dimension = Dimension + 1
endloop
set Index = Index + 1
endloop
return Ret
endfunction
function RegainCode takes string S returns string
local integer L = GetLength(S)
local integer Rows = R2I(L / 5)
local integer Mod
local integer Lines
local string array New
local string Ret = ""
local integer Index = 0
local integer Zaehler = 0
local integer Dimension = 0
if Rows > 20 then
set Rows = 20
elseif Rows == 0 then
set Rows = 1
endif
set Mod = ModuloInteger(L,Rows)
set Lines = (L - Mod) / Rows
loop
exitwhen Index >= L
if Dimension < Mod then
set Index = Index + 1
set New[udg_zz_CodeRows[Dimension] + (Lines + 1) * 20] = SubStringBJ(S,Index,Index)
endif
set Zaehler = 1
loop
exitwhen Zaehler > Lines
set Index = Index + 1
set New[udg_zz_CodeRows[Dimension] + (Lines - Zaehler + 1) * 20] = SubStringBJ(S,Index,Index)
set Zaehler = Zaehler + 1
endloop
set Dimension = Dimension + 1
endloop
set Index = 0
set Dimension = 1
set Zaehler = 1
loop
exitwhen Zaehler > L
if Index >= Rows then
set Dimension = Dimension + 1
set Index = Index - Rows
endif
set Ret = Ret + New[udg_zz_CodeRows[Index] + Dimension * 20]
set Index = Index + 1
set Zaehler = Zaehler + 1
endloop
return Ret
endfunction
function OneCharInt2CodeStr takes string S, integer Running returns string
local integer I = S2I(S)
if ModuloInteger(Running,2) == 1 then
return udg_zz_CodeIdA[I]
endif
return udg_zz_CodeIdB[I]
endfunction
function OneCharCodeStr2Int takes string S, integer Running returns string
local integer Index = 0
loop
exitwhen udg_zz_CodeIdA[Index] == S
exitwhen udg_zz_CodeIdB[Index] == S
set Index = Index + 1
endloop
return I2S(Index)
endfunction
function CodeStr2Int takes string S returns integer
local integer L = GetLength(S)
local integer Index = 1
local string Ret = ""
loop
set Ret = Ret + OneCharCodeStr2Int(SubStringBJ(S,Index,Index),Index)
exitwhen Index == L
set Index = Index + 1
endloop
return S2I(Ret)
endfunction
function Int2CodeStr takes integer I, integer Stellen returns string
local string S = I2S(I)
local integer L = GetLength(S)
local integer Index = 1
local string Ret = ""
loop
exitwhen GetLength(S) == Stellen
set S = "0" + S
endloop
set L = GetLength(S)
loop
set Ret = Ret + OneCharInt2CodeStr(SubStringBJ(S,Index,Index),Index)
exitwhen Index == L
set Index = Index + 1
endloop
return Ret
endfunction
function AddScores takes string S returns string
local string Ret = ""
local integer L = GetLength(S)
local integer Index = 1
local integer Counter = 0
loop
set Ret = Ret + SubStringBJ(S,Index,Index)
exitwhen Index == L
set Index = Index + 1
set Counter = Counter + 1
if Counter == 6 then
set Ret = Ret + "-"
set Counter = 0
endif
endloop
return Ret
endfunction
function DeleteSubStringFromString takes string S, string Char returns string
local integer Index = 1
local integer L = GetLength(S)
local integer CompLen = GetLength(Char)
local integer CurLen = 0
local string Current = ""
local string Ret = ""
loop
set Current = Current + SubStringBJ(S,Index,Index)
set CurLen = CurLen + 1
if Current != SubStringBJ(Char,1,GetLength(Current)) then
set Ret = Ret + Current
set CurLen = 0
set Current = ""
elseif CurLen == CompLen then
set CurLen = 0
set Current = ""
elseif Index >= L then
set Ret = Ret + Current
endif
exitwhen Index >= L
set Index = Index + 1
endloop
return Ret
endfunction
function DeleteCharFromString takes string S, string Char returns string
local integer Index = 1
local integer L = GetLength(S)
local string Current
local string Ret = ""
loop
set Current = SubStringBJ(S,Index,Index)
if Current != Char then
set Ret = Ret + Current
endif
exitwhen Index >= L
set Index = Index + 1
endloop
return Ret
endfunction
function SaveRestoredSkillcode takes integer id, integer skillctr, unit U returns nothing
local integer Uid = GetUniqueEinheitsnummer(U)
if skillctr == 1 then
set udg_zz_HeroSkill1[Uid] = id
elseif skillctr == 2 then
set udg_zz_HeroSkill2[Uid] = id
elseif skillctr == 3 then
set udg_zz_HeroSkill3[Uid] = id
elseif skillctr == 4 then
set udg_zz_HeroSkill4[Uid] = id
else
set udg_zz_HeroSkill5[Uid] = id
endif
endfunction
function RestoreHeroDataNew takes string S, player P, boolean storedLoc, location Loc returns nothing
local integer X
local integer Y
local integer UnitType
local unit U
local integer XP
local integer Life
local integer Mana
local integer Gold
local integer Lumber
local integer Index = 34
local integer Counter = 1
local integer Level
local integer Abilcount = 0
local integer TempCode
local integer skillctr = 0
local string pname
set S = DeleteCharFromString(S,"-")
set S = RegainCode(RegainCode(S))
if udg_zz_SaveLoadSettings[6] then
set pname = GetPlayerName(P)
if GetLength(pname) < 5 then
set Counter = 5 - GetLength(pname)
set pname = SubStringBJ(pname,1,GetLength(pname))
loop
set pname = pname + "Q"
set Counter = Counter - 1
exitwhen Counter <= 0
endloop
set Counter = 1
else
set pname = SubStringBJ(pname,1,5)
endif
if SubStringBJ(S,1,5) != pname then
call DisplayTimedTextToPlayer(P,0,0,5,"Wrong player profile")
return
endif
set UnitType = IdString2DebugIdInteger(SubStringBJ(S,6,9))
else
set UnitType = IdString2DebugIdInteger(SubStringBJ(S,1,4))
endif
if storedLoc then
if udg_zz_SaveLoadSettings[0] then
if udg_zz_SaveLoadSettings[6] then
set X = CodeStr2Int(SubStringBJ(S,15,17))
set Y = CodeStr2Int(SubStringBJ(S,18,20))
else
set X = CodeStr2Int(SubStringBJ(S,10,12))
set Y = CodeStr2Int(SubStringBJ(S,13,15))
endif
set X = X * 100
set Y = Y * 100
set X = X - 50000
set Y = Y - 50000
if udg_zz_SaveLoadSettings[6] then
set Index = 21
else
set Index = 16
endif
else
if udg_zz_SaveLoadSettings[6] then
set Index = 15
else
set Index = 10
endif
set X = 0
set Y = 0
endif
call CreateNUnitsAtLoc(1,UnitType,P,Location(I2R(X),I2R (Y)),90)
else
call CreateNUnitsAtLoc(1,UnitType,P,Loc,90)
if udg_zz_SaveLoadSettings[6] then
set Index = 15
else
set Index = 10
endif
endif
set U = GetLastCreatedUnit()
if udg_zz_SaveLoadSettings[6] then
set XP = CodeStr2Int(SubStringBJ(S,10,14))
else
set XP = CodeStr2Int(SubStringBJ(S,5,9))
endif
call SetHeroLevelBJ(U,XP,false)
if udg_zz_SaveLoadSettings[1] then
set Life = CodeStr2Int(SubStringBJ(S,Index,Index + 1)) + 1
set Mana = CodeStr2Int(SubStringBJ(S,Index + 2,Index + 3)) + 1
set Index = Index + 4
if Life > 100 then
set Life = 100
endif
if Mana > 100 then
set Mana = 100
endif
endif
if udg_zz_SaveLoadSettings[2] then
call SetHeroStr(U,CodeStr2Int(SubStringBJ(S,Index,Index + 1)),true)
call SetHeroAgi(U,CodeStr2Int(SubStringBJ(S,Index + 2,Index + 3)),true)
call SetHeroInt(U,CodeStr2Int(SubStringBJ(S,Index + 4,Index + 5)),true)
set Index = Index + 6
endif
if udg_zz_SaveLoadSettings[3] then
set Gold = CodeStr2Int(SubStringBJ(S,Index,Index + 3))
set Lumber = CodeStr2Int(SubStringBJ(S,Index + 4,Index + 7))
set Gold = Gold * 10
set Lumber = Lumber * 10
call SetPlayerStateBJ(P,PLAYER_STATE_RESOURCE_GOLD,Gold)
call SetPlayerStateBJ(P,PLAYER_STATE_RESOURCE_LUMBER,Lumber)
set Index = Index + 8
endif
if udg_zz_SaveLoadSettings[4] then
loop
if SubStringBJ(S,Index, Index) != "X" then
call UnitAddItemToSlotById(U,IdString2DebugIdInteger(SubStringBJ(S,Index,Index + 3)),Counter - 1)
set Index = Index + 4
else
set Index = Index + 1
endif
exitwhen Counter == 6
set Counter = Counter + 1
endloop
endif
if udg_zz_SaveLoadSettings[5] then
loop
set Counter = 0
if CodeStr2Int(SubStringBJ(S,Index, Index)) > 0 then
set Level = CodeStr2Int(SubStringBJ(S,Index, Index))
set TempCode = IdString2DebugIdInteger(SubStringBJ(S,Index + 1,Index + 4))
set skillctr = skillctr + 1
call SaveRestoredSkillcode(TempCode,skillctr,U)
loop
call SelectHeroSkill(U,TempCode)
set Counter = Counter + 1
exitwhen Counter == Level
endloop
set Index = Index + 5
else
set Index = Index + 1
endif
set Abilcount = Abilcount + 1
exitwhen Abilcount == 5
endloop
endif
if udg_zz_SaveLoadSettings[1] then
call SetUnitLifePercentBJ(U,I2R(Life))
call SetUnitManaPercentBJ(U,I2R(Mana))
endif
set bj_lastCreatedUnit = U
endfunction
function RestoreHeroData takes string S, player P returns nothing
call RestoreHeroDataNew(S,P,true,GetRectCenter(GetPlayableMapRect()))
endfunction
function RestoreHeroAtLoc takes string S, player P, location L returns nothing
call RestoreHeroDataNew(S,P,false,L)
endfunction
function IsUpperCaseLetter takes string S returns boolean
if S == "A" or S == "B" or S == "C" or S == "D" or S == "E" or S == "F" or S == "G" or S == "H" or S == "I" or S == "J" or S == "K" or S == "L" or S == "M" or S == "N" or S == "O" or S == "P" or S == "Q" then
return true
elseif S == "R" or S == "S" or S == "T" or S == "U" or S == "V" or S == "W" or S == "X" or S == "Y" or S == "Z" then
return true
endif
return false
endfunction
function IsLowerCaseLetter takes string S returns boolean
if S == "a" or S == "b" or S == "c" or S == "d" or S == "e" or S == "f" or S == "g" or S == "h" or S == "i" or S == "j" or S == "k" or S == "l" or S == "m" or S == "n" or S == "o" or S == "p" or S == "q" then
return true
elseif S == "r" or S == "s" or S == "t" or S == "u" or S == "v" or S == "w" or S == "x" or S == "y" or S == "z" then
return true
endif
return false
endfunction
function ColorHeroCode takes string S returns string
local integer L = GetLength(S)
local integer Index = 1
local string Ret = ""
local string Temp
loop
exitwhen Index > L
set Temp = SubStringBJ(S,Index,Index)
if IsUpperCaseLetter(Temp) then
set Ret = Ret + "|cff33ffff" + Temp + "|r"
elseif IsLowerCaseLetter(Temp) then
set Ret = Ret + "|cffffccff" + Temp + "|r"
else
set Ret = Ret + "|cffffcc00" + Temp + "|r"
endif
set Index = Index + 1
endloop
return Ret
endfunction
function SaveHeroData takes unit U, player P returns nothing
local integer Id = GetUniqueEinheitsnummer(U)
local string Code = ""
local integer XP
local integer X
local integer Y
local integer Life
local integer Mana
local integer Agi
local integer Str
local integer Int
local integer Gold
local integer Lumber
local integer Uid
local string Final
local string pname
local integer Counter = 0
if IsUnitType(U,UNIT_TYPE_HERO) == false then
return
endif
if udg_zz_SaveLoadSettings[6] then
set pname = GetPlayerName(P)
if GetLength(pname) < 5 then
set Counter = 5 - GetLength(pname)
set pname = SubStringBJ(pname,1,GetLength(pname))
loop
set pname = pname + "Q"
set Counter = Counter - 1
exitwhen Counter <= 0
endloop
else
set pname = SubStringBJ(pname,1,5)
endif
set Code = pname
set Code = Code + DebugIdInteger2IdString(GetUnitTypeId(U))
else
set Code = DebugIdInteger2IdString(GetUnitTypeId(U))
endif
set XP=GetHeroLevel(U)
if XP>99999 then
set XP=99999
elseif XP<1 then
set XP=1
endif
set Code=Code+Int2CodeStr(XP,5)
if udg_zz_SaveLoadSettings[0] then
set X = R2I(GetUnitX(U))
set Y = R2I(GetUnitY(U))
if X < - 50000 then
set X = - 50000
endif
if X >= 50000 then
set X = 49999
endif
set X = X + 50000
if Y < - 50000 then
set Y = - 50000
endif
if Y >= 50000 then
set Y = 49999
endif
set Y = Y + 50000
set X = X / 100
set Y = Y / 100
set Code = Code + Int2CodeStr(X,3)
set Code = Code + Int2CodeStr(Y,3)
endif
if udg_zz_SaveLoadSettings[1] then
set Life = R2I(GetUnitLifePercent(U) - 1)
set Mana = R2I(GetUnitManaPercent(U) - 1)
if Life <= 0 then
set Life = 0
endif
if Mana < 0 then
set Mana = 0
endif
set Code = Code + Int2CodeStr(Life,2)
set Code = Code + Int2CodeStr(Mana,2)
endif
if udg_zz_SaveLoadSettings[2] then
set Str = GetHeroStatBJ(bj_HEROSTAT_STR,U,false)
set Agi = GetHeroStatBJ(bj_HEROSTAT_AGI,U,false)
set Int = GetHeroStatBJ(bj_HEROSTAT_INT,U,false)
if Agi > 99 then
set Agi = 99
endif
if Str > 99 then
set Str = 99
endif
if Int > 99 then
set Int = 99
endif
set Code = Code + Int2CodeStr(Str,2)
set Code = Code + Int2CodeStr(Agi,2)
set Code = Code + Int2CodeStr(Int,2)
endif
if udg_zz_SaveLoadSettings[3] then
set Gold = GetPlayerState(GetOwningPlayer(U),PLAYER_STATE_RESOURCE_GOLD)
set Lumber = GetPlayerState(GetOwningPlayer(U),PLAYER_STATE_RESOURCE_LUMBER)
if Gold > 99999 then
set Gold = 99999
endif
if Lumber > 99999 then
set Lumber = 99999
endif
set Gold = Gold / 10
set Lumber = Lumber / 10
set Code = Code + Int2CodeStr(Gold,4)
set Code = Code + Int2CodeStr(Lumber,4)
endif
if udg_zz_SaveLoadSettings[4] then
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,1) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,1))),"X")
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,2) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,2))),"X")
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,3) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,3))),"X")
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,4) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,4))),"X")
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,5) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,5))),"X")
set Code = Code + TertiaryStringOp(UnitItemInSlotBJ(U,6) != null,DebugIdInteger2IdString(GetItemTypeId(UnitItemInSlotBJ(U,6))),"X")
endif
if udg_zz_SaveLoadSettings[5] then
set Uid = GetUniqueEinheitsnummer(U)
set Code = Code + Int2CodeStr(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill1[Uid],U),1)
set Code = Code + TertiaryStringOp(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill1[Uid],U) > 0,DebugIdInteger2IdString(udg_zz_HeroSkill1[Uid]),"")
set Code = Code + Int2CodeStr(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill2[Uid],U),1)
set Code = Code + TertiaryStringOp(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill2[Uid],U) > 0,DebugIdInteger2IdString(udg_zz_HeroSkill2[Uid]),"")
set Code = Code + Int2CodeStr(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill3[Uid],U),1)
set Code = Code + TertiaryStringOp(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill3[Uid],U) > 0,DebugIdInteger2IdString(udg_zz_HeroSkill3[Uid]),"")
set Code = Code + Int2CodeStr(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill4[Uid],U),1)
set Code = Code + TertiaryStringOp(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill4[Uid],U) > 0,DebugIdInteger2IdString(udg_zz_HeroSkill4[Uid]),"")
set Code = Code + Int2CodeStr(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill5[Uid],U),1)
set Code = Code + TertiaryStringOp(GetUnitAbilityLevelSwapped(udg_zz_HeroSkill5[Uid],U) > 0,DebugIdInteger2IdString(udg_zz_HeroSkill5[Uid]),"")
endif
set Final = ColorHeroCode(AddScores(AssembleCode(AssembleCode(Code))))
call DisplayTimedTextToPlayer(P,0,0,180,Final)
endfunction
function SetHeroSaveLoadOptions takes boolean Value, integer Op returns nothing
set udg_zz_SaveLoadSettings[Op] = Value
endfunction
function Integer2UnitId takes string Zahl returns integer
return IdString2DebugIdInteger(Zahl)
endfunction
function Integer2ItemId takes string Zahl returns integer
return IdString2DebugIdInteger(Zahl)
endfunction
function Integer2DoodadId takes string Zahl returns integer
return IdString2DebugIdInteger(Zahl)
endfunction
function Integer2SpellId takes string Zahl returns integer
return IdString2DebugIdInteger(Zahl)
endfunction
function TriggerName2Function takes string S returns string
local integer L = GetLength(S)
local integer Index = 1
local string Temp
local string Ret = "Trig_"
loop
set Temp = SubStringBJ(S,Index,Index)
if Temp == " " then
set Ret = Ret + "_"
else
set Ret = Ret + Temp
endif
exitwhen Index == L
set Index = Index + 1
endloop
set Ret = Ret + "_Actions"
return Ret
endfunction
function GetTheTriggerOrderString takes nothing returns string
return OrderId2StringBJ(GetIssuedOrderIdBJ())
endfunction
function String2PointOrder takes string S returns string
return S
endfunction
function String2UnitOrder takes string S returns string
return S
endfunction
function String2DestOrder takes string S returns string
return S
endfunction
function String2NoOrder takes string S returns string
return S
endfunction
function AddAnyUnitIssuedAnyOrderEvent takes trigger Trig returns nothing
local integer Index = 0
loop
call TriggerRegisterPlayerUnitEventSimple(Trig,Player(Index),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterPlayerUnitEventSimple(Trig,Player(Index),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterPlayerUnitEventSimple(Trig,Player(Index),EVENT_PLAYER_UNIT_ISSUED_ORDER)
exitwhen Index == 11
set Index = Index + 1
endloop
endfunction
function RegisterNewDamageEvent takes nothing returns nothing
call GetUniqueEinheitsnummer(GetEnumUnit())
call TriggerRegisterUnitEvent(udg_zz_AnyDamageTrig,GetEnumUnit(),EVENT_UNIT_DAMAGED)
endfunction
function AnyDamageActions takes nothing returns nothing
set udg_zz_DamageTaken = 100
set udg_zz_DamageTaken = 0
endfunction
function AnyDamageEvent takes trigger T returns nothing
call TriggerRegisterVariableEvent(T,"udg_zz_DamageTaken",EQUAL,100.00)
endfunction
function String2Colorhex takes string S returns string
return S
endfunction
function GetAnzahlSpieler takes nothing returns integer
local integer Index = 0
local integer Anzahl = 0
loop
if GetPlayerSlotState(Player(Index)) == PLAYER_SLOT_STATE_PLAYING then
if GetPlayerController(Player(Index)) == MAP_CONTROL_USER then
if IsPlayerObserver(Player(Index)) == false then
set Anzahl = Anzahl + 1
endif
endif
endif
exitwhen Index == 11
set Index = Index + 1
endloop
return Anzahl
endfunction
function Dez2Hex takes integer I returns string
if I < 10 and I >= 0 then
return I2S(I)
elseif I == 10 then
return "a"
elseif I == 11 then
return "b"
elseif I == 12 then
return "c"
elseif I == 13 then
return "d"
elseif I == 14 then
return "e"
elseif I == 15 then
return "f"
endif
return I2S(I)
endfunction
function OneCharDezToHex takes integer I returns integer
set udg_zz_ModuloHex = ModuloInteger(I,16)
set I = I - udg_zz_ModuloHex
return I / 16
endfunction
function Dez2HexS takes integer I returns string
local string array Stelle
local integer Index = 0
local string Sum = ""
loop
set I = OneCharDezToHex(I)
set Stelle[Index] = Dez2Hex(udg_zz_ModuloHex)
exitwhen I == 0
set Index = Index + 1
endloop
loop
set Sum = Sum + Stelle[Index]
exitwhen Index == 0
set Index = Index - 1
endloop
return Sum
endfunction
function Hex2Dez takes string S returns integer
if S == "0" or S == "1" or S == "2" or S == "3" or S == "4" or S == "5" or S == "6" or S == "7" or S == "8" or S == "9" then
return S2I(S)
elseif S == "a" then
return 10
elseif S == "b" then
return 11
elseif S == "c" then
return 12
elseif S == "d" then
return 13
elseif S == "e" then
return 14
elseif S == "f" then
return 15
endif
return S2I(S)
endfunction
function HexS2Dez takes string S returns integer
local integer array Zahl
local integer Index = 0
local integer Zaehler = 0
local integer Sum = 0
local integer Length = GetLength(S)
loop
set Zahl[Index] = Hex2Dez(SubStringBJ(S,Index + 1, Index + 1))
exitwhen Index + 1 == Length
set Index = Index + 1
endloop
loop
exitwhen Index == 0
set Zahl[Zaehler] = R2I(Zahl[Zaehler]*Pow(16.00,I2R(Index)))
exitwhen Index == 1
set Zaehler = Zaehler + 1
set Index = Index - 1
endloop
set Index = 0
loop
set Sum = Sum + Zahl[Index]
exitwhen Index + 1 == Length
set Index = Index + 1
endloop
return Sum
endfunction
function CombineColor takes integer I returns string
local string array Converted
local integer Index = 0
loop
set Converted[Index] = Dez2HexS(udg_zz_Anfangsfarbe[Index] + R2I(I*udg_zz_Farbinterval[Index]))
if GetLength(Converted[Index]) == 1 then
set Converted[Index] = "0" + Converted[Index]
endif
exitwhen Index == 2
set Index = Index + 1
endloop
return Converted[0] + Converted[1] + Converted[2]
endfunction
function Farbverlauf takes string Anfangsfarbe, string Endfarbe, string Text returns string
local integer L = GetLength(Text)
local integer array Ende
local integer array Abstand
local string Result = ""
local integer Index = 0
local integer array Modifikator
set udg_zz_Anfangsfarbe[0] = HexS2Dez(SubStringBJ(Anfangsfarbe,1,2))
set udg_zz_Anfangsfarbe[1] = HexS2Dez(SubStringBJ(Anfangsfarbe,3,4))
set udg_zz_Anfangsfarbe[2] = HexS2Dez(SubStringBJ(Anfangsfarbe,5,6))
set Ende[0] = HexS2Dez(SubStringBJ(Endfarbe,1,2))
set Ende[1] = HexS2Dez(SubStringBJ(Endfarbe,3,4))
set Ende[2] = HexS2Dez(SubStringBJ(Endfarbe,5,6))
set Abstand[0] = Ende[0] - udg_zz_Anfangsfarbe[0]
set Abstand[1] = Ende[1] - udg_zz_Anfangsfarbe[1]
set Abstand[2] = Ende[2] - udg_zz_Anfangsfarbe[2]
loop
if Abstand[Index] < 0 then
set Modifikator[Index] = Abstand[Index] + 1
else
set Modifikator[Index] = Abstand[Index] - 1
endif
set udg_zz_Farbinterval[Index] = (I2R(Abstand[Index])/I2R(L)) + (1.00/I2R(Modifikator[Index]))
exitwhen Index == 2
set Index = Index + 1
endloop
set Index = 0
loop
set Result = Result + "|cff" + CombineColor(Index) + SubStringBJ(Text,Index + 1,Index + 1) + "|r"
exitwhen Index + 1 == L
set Index = Index + 1
endloop
return Result
endfunction
function HidePortraits takes force F returns nothing
call ShowInterfaceForceOff(F,0.00)
call ShowInterfaceForceOn(F,0.00)
endfunction
function Ix takes integer x, integer y returns integer
return(x*12+y)
endfunction
function ClearBonus takes unit who,integer t returns nothing
local integer i=0
loop
call UnitRemoveAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who)
exitwhen i==11
set i=i+1
endloop
endfunction
function GetBonus takes unit who,integer t returns integer
local integer array bit
local integer i=1
local integer bonus=0
set bit[0]=1
loop
set bit[i]=bit[i-1]*2
exitwhen i==11
set i=i+1
endloop
set i=i+1
loop
if (UnitRemoveAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who)==true) then
call UnitAddAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who)
set bonus=bonus+bit[i]
endif
exitwhen i==0
set i=i-1
endloop
return (bonus)
endfunction
function SetBonus takes integer amount,unit who,integer t returns boolean
local integer bonus=amount
local integer array bit
local integer i=1
set bit[0]=1
loop
set bit[i]=bit[i-1]*2
exitwhen i==11
set i=i+1
endloop
call ClearBonus(who,t)
loop
if (bonus>=bit[i]) then
call UnitAddAbilityBJ(udg_zz_BnsBit[Ix(t,i)],who)
set bonus=bonus-bit[i]
endif
exitwhen i==0
set i=i-1
endloop
return (amount<=4095 and t<=3 and t>=0 and amount>=0 and who!=null)
endfunction
function AddBonus takes integer amount,unit who,integer t returns boolean
return SetBonus((GetBonus(who,t)+amount),who,t)
endfunction
function ChangeManaRegeneration takes player Spieler, boolean Increase, integer Race, real Percent returns nothing
local integer Type
if Increase == true then
set Type = udg_zz_ManaRegenUpgr[Race]
else
set Type = udg_zz_ManaRegenUpgr[Race + 4]
endif
if GetPlayerTechCountSimple(Type,Spieler) + R2I(10*Percent) > 4095 then
call SetPlayerTechResearchedSwap(Type,4095,Spieler)
else
call SetPlayerTechResearchedSwap(Type,GetPlayerTechCountSimple(Type,Spieler)+R2I(10*Percent),Spieler)
endif
endfunction
function ChangeLifeRegeneration takes player Spieler, boolean Increase, integer Race, real Percent returns nothing
local integer Type
if Increase == true then
set Type = udg_zz_LifeRegenUpgr[Race]
else
set Type = udg_zz_LifeRegenUpgr[Race + 4]
endif
if GetPlayerTechCountSimple(Type,Spieler) + R2I(Percent*10) > 4095 then
call SetPlayerTechResearchedSwap(Type,4095,Spieler)
else
call SetPlayerTechResearchedSwap(Type,GetPlayerTechCountSimple(Type,Spieler)+R2I(Percent*10),Spieler)
endif
endfunction
function ChangeAttackDices takes player Spieler, boolean Increase, integer Race, integer Zahl returns nothing
local integer Type
if Increase == true then
set Type = udg_zz_AttackDiceUpgr[Race]
else
set Type = udg_zz_AttackDiceUpgr[Race + 4]
endif
if GetPlayerTechCountSimple(Type,Spieler) + Zahl > 4095 then
call SetPlayerTechResearchedSwap(Type,4095,Spieler)
else
call SetPlayerTechResearchedSwap(Type,GetPlayerTechCountSimple(Type,Spieler)+Zahl,Spieler)
endif
endfunction
function ChangeLeeching takes unit U, boolean Increase, integer Zahl returns nothing
if not Increase then
set Zahl = 0 - Zahl
endif
call AddBonus(Zahl,U,5)
endfunction
function ChangeSightRange takes unit U, boolean Increase, integer Zahl returns nothing
if not Increase then
set Zahl = 0 - Zahl
endif
call AddBonus(Zahl,U,4)
endfunction
function ChangeMana takes unit U, boolean Increase, integer Zahl returns nothing
if not Increase then
set Zahl = 0 - Zahl
endif
call AddBonus(Zahl,U,3)
endfunction
function ChangeLife takes unit U, boolean Increase, integer Zahl returns nothing
if not Increase then
set Zahl = 0 - Zahl
endif
call AddBonus(Zahl,U,2)
endfunction
function ChangeDamage takes unit U, boolean Increas
_________________
||**||
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé MSN Messenger
 Troll-Brain
Ri1kamoua


Inscrit le: 23 Aoû 2007
Messages: 7143
Sujets: 147
Spécialité en worldedit: le troll, le flood, la vulgarité, mon coeur balance
Médailles: 2 (En savoir plus...)
Rédacteur de tuto #3 (Quantité : 1) Grand mage créateur de sort (Quantité : 1)

MessagePosté le: 14/07/10 22:56    Sujet du message: Citer

WEU est largement dépassé et supplanté par le JassNewGenPack.
D'ailleurs WEU ne doit pas être compatible avec les nouveaux patchs de wc3.

Et il y a en effet une foule de fonction custom, intégrés à l'interface GUI, dans le but de combler les nombreuses lacunes du GUI sans arriver à les combler totalement bien sûr.
Sans que compter que certaines fonctions ne sont plus du conforme aux standards actuels.
_________________
Le violet, c'est moche.
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé
 DaKanibal
Membre a fort taux de post


Inscrit le: 12 Sep 2009
Messages: 801
Sujets: 64
Spécialité en worldedit: Ne pas.


MessagePosté le: 14/07/10 23:43    Sujet du message: Citer

Ah ok merci
_________________
||**||
Revenir en haut
Voir le profil de l'utilisateur Envoyer un message privé MSN Messenger
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Worldedit Index du Forum -> Autre Toutes les heures sont au format GMT + 1 Heure
Page 1 sur 1

 
Sauter vers:  
Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum


Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com