Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 09/07/14 20:00 Sujet du message: Bug compte objets aléatoires
J'ai essayé d'utiliser les itempools (qui sont nos amis) et ça a très bien marché, sauf que lorsque je vérifie le nombre d'objets de tel type ben, c'est pas spécialement exact. Et je comprend pas trop pourquoi (c'est pas spécialement utile mais ça aide pour les conjectures d'équilibrage du drop).
function AddItemtoPool takes nothing returns nothing
local real m = 1.00
local real r = GetRandomReal(0.00, m)
set m = m - r
call ItemPoolAddItemType( pool, 'gcel', r )
call BJDebugMsg( "Glove of Haste: " + R2S(r * 100.00) + "%" )
if m > 0.00 then
set r = GetRandomReal(0.00, m)
set m = m - r
call ItemPoolAddItemType( pool, 'prvt', r )
call BJDebugMsg( "Pendant of Vitality: " + R2S(r * 100.00) + "%" )
endif
if m > 0.00 then
set r = GetRandomReal(0.00, m)
set m = m - r
call ItemPoolAddItemType( pool, 'pmna', r )
call BJDebugMsg( "Pendant of Mana: " + R2S(r * 100.00) + "%" )
endif
if m > 0.00 then
set r = GetRandomReal(0.00, m)
set m = m - r
call ItemPoolAddItemType( pool, 'phea', r )
call BJDebugMsg( "Healing Potion: " + R2S(r * 100.00) + "%" )
endif
if m > 0.00 then
set r = GetRandomReal(0.00, m)
set m = m - r
call ItemPoolAddItemType( pool, 'none', r )
call BJDebugMsg( "Nothing: " + R2S(r * 100.00) + "%" )
endif
endfunction
endlibrary
Gui:
Trigger:
Torment only Events Time - Elapsed game time is 5.00 seconds Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Torment Equal to False
Then - Actions Game - Display to (All players) the text: Torment is Off Custom script: call ItemPoolRemoveItemType( pool, 'gcel' ) Custom script: call ItemPoolRemoveItemType( pool, 'prvt' ) Custom script: call ItemPoolRemoveItemType( pool, 'pmna' ) Else - Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions Custom script: set udg_Item = PlaceRandomItem(pool, udg_X, udg_Y ) Set X = (X + 64.00) Set Y = (Cos(X))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of Item) Equal to Gloves of Haste
Then - Actions Set Count[1] = (Count[1] + 1) Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of Item) Equal to Periapt of Vitality
Then - Actions Set Count[2] = (Count[2] + 1) Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of Item) Equal to Pendant of Energy
Then - Actions Set Count[3] = (Count[3] + 1) Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of Item) Equal to Potion of Healing
Then - Actions Set Count[4] = (Count[4] + 1) Else - Actions Set Count[5] = (Count[5] + 1)
Custom script: call BJDebugMsg( "There are " + I2S(udg_Count[1]) + " Gloves of Haste on the map" ) Custom script: call BJDebugMsg( "There are " + I2S(udg_Count[2]) + " Pendants of Vitality on the map" ) Custom script: call BJDebugMsg( "There are " + I2S(udg_Count[3]) + " Pendants of Mana on the map" ) Custom script: call BJDebugMsg( "There are " + I2S(udg_Count[4]) + " Healing Potions on the map" ) Custom script: call BJDebugMsg( "There are " + I2S(udg_Count[5]) + " Nonexistant Items on the map" )
Gui:
Trigger:
Torment Events Player - Player 1 (Red) types a chat message containing -t as An exact match Conditions
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