Si j'avais su, j'aurais terminé la fonction de création automatique de projectile que je m'étais amusé à écrire il y a plusieurs mois.
Tout d'abord, un petit conseil lorsque tu assignes un projectile à un sort : évite d'assigner le projectile à une adresse fixe et privilégie les fonctions WeiDU. D'abord, ça t'évite des lignes de codes inutiles si ton sort a plusieurs headers (un par niveau par exemple). Mais surtout, si tu ajoutes ou supprimes un effet à ton sort en cours de route, tes adresses vont changer. Donc :
Code : Tout sélectionner
COPY ~%MOD_FOLDER%/Kits/Chevalier/GWCD222.spl~ ~override/GWCD222.spl~
[color="#00FFFF"]LPF ALTER_SPELL_HEADER INT_VAR projectile = (IDS_OF_SYMBOL (projectl GWManBS) + 1) END[/color]
BUT_ONLY
COPY ~%MOD_FOLDER%/Kits/GWCD212.spl~ ~override/GWCD212.spl~ SAY NAME1 #12041 SAY UNIDENTIFIED_DESC #12160
WRITE_LONG 0x18 THIS | BIT25 // add Castable when silenced
[color="#00FFFF"]LPF ALTER_SPELL_HEADER INT_VAR projectile = (IDS_OF_SYMBOL (projectl GWInAr25) + 1) END[/color]
BUT_ONLY
COPY ~%MOD_FOLDER%/Kits/Chevalier/GWTemSa.spl~ ~override/GWTemSa.spl~ SAY NAME1 @7503019 SAY UNIDENTIFIED_DESC @7719306
[color="#00FFFF"]LPF ALTER_SPELL_HEADER INT_VAR projectile = (IDS_OF_SYMBOL (projectl GWTemSaP) + 1) END[/color]
BUT_ONLY
Ceci étant dit,
petit florilège des codes WeiDU à utiliser pour modifier un projectile, en commençant par le plus simple :
Code : Tout sélectionner
// Flèche purificatrice.
// ---------------------
COPY_EXISTING ~ARROWEX.pro~ ~override/GWFlePu.pro~ // 3-Arrow Exploding (ARROWEX)
WRITE_SHORT 0x00a 60 // Projectile speed
WRITE_LONG 0x200 THIS | BIT6 // Area projectile flags : ajoute Affect only enemies
PATCH_FOR_EACH index2 IN 0x12c 0x12d 0x12e 0x12f 0x130 0x131 0x132 BEGIN
WRITE_BYTE %index2% 80 // Smoke colours : 80-Saturated Bronze
END
BUT_ONLY
ADD_PROJECTILE ~override/GWFlePu.pro~ ~Arrow of Purification~
// Flèche de flammes noires.
// -------------------------
COPY_EXISTING ~ARROWFLI.pro~ ~override/GWFleFN.pro~ // 188-Flame arrow ice (ARROWFLI)
PATCH_FOR_EACH index1 IN 0x124 0x125 0x126 0x127 0x128 0x129 0x12a BEGIN
WRITE_BYTE %index1% 29 // Projectile colours : 29-Red Tinted Black
END
PATCH_FOR_EACH index2 IN 0x12c 0x12d 0x12e 0x12f 0x130 0x131 0x132 BEGIN
WRITE_BYTE %index2% 72 // Smoke colours : 72-Steel Gray
END
BUT_ONLY
ADD_PROJECTILE ~override/GWFleFN.pro~ ~Arrow of Dark Flames~
Code : Tout sélectionner
// Bâtons de magicien
// ------------------
ACTION_FOR_EACH MMissile_Proj IN ~GWMMisBl~ ~GWMMisCy~ ~GWMMisGd~ ~GWMMisMa~ ~GWMMisPu~ ~GWMMisRd~ ~GWMMisVt~ ~GWMMisWh~ BEGIN
COPY_EXISTING ~MAGICMIS.pro~ ~override/%MMissile_Proj%.pro~
TO_UPPER %DEST_RES%
WRITE_ASCIIE 0x104 "%DEST_RES%" #8 // Projectile animation (BAM)
BUT_ONLY
ADD_PROJECTILE ~override/%MMissile_Proj%.pro~
END
// Dagues de jet.
// --------------
ADD_PROJECTILE ~%MOD_FOLDER%/Proj/GWDag51.pro~ ~Dagger Green~ // Dague de lancer verte
COPY_EXISTING ~GWDag51.pro~ ~override/GWDag52.pro~ // Dague de lancer bleue
WRITE_BYTE 0x0128 82 // Projectile color 5
WRITE_BYTE 0x0129 68 // Projectile color 6
ADD_PROJECTILE ~override/GWDag52.pro~ ~Dagger Blue~
Code : Tout sélectionner
// Lance alicorne.
// ---------------
COPY_EXISTING ~LIGHTBLT.pro~ ~override/GWLceAli.pro~ //
WRITE_SHORT 0x00a 40 // Projectile speed
WRITE_ASCII 0x010 GWTRA19 #8 // WAVC file (travelling)
WRITE_LONG 0x100 THIS | BIT4 | BIT6 | BIT7 // BAM projectile flags : Bit4 : Enable area height usage - Bit6 : Enable light spot - Bit7 : Enable brighten flags
WRITE_ASCII 0x104 GWLCEALP // Projectile animation
WRITE_SHORT 0x116 30 // Light spot intensity (Z)
WRITE_SHORT 0x118 20 // Light spot width (X)
WRITE_SHORT 0x11a 45 // Light spot height (Y)
BUT_ONLY
ADD_PROJECTILE ~override/GWLceAli.pro~ ~Alicorn Lance~
Code : Tout sélectionner
// Potions.
// --------
ACTION_FOR_EACH Potions_Proj IN ~GWPotnAg~ ~GWPotnBl~ ~GWPotnCy~ ~GWPotnGd~ ~GWPotnJa~ BEGIN
COPY_EXISTING ~MAGICMIS.pro~ ~override/%Potions_Proj%.pro~
TO_UPPER %DEST_RES%
WRITE_SHORT 0x00a 20 // Projectile speed (0x01 to 0xFF) : 1 à 255
WRITE_ASCIIE 0x104 "%DEST_RES%" #8 // Projectile animation (BAM)
PATCH_IF ("%DEST_RES%" STRING_COMPARE_CASE "GWPotnBl" = 0) BEGIN
WRITE_LONG 0x100 (THIS BAND BNOT BIT7) // BAM projectile flags : remove Bit7 : Enable brighten flags (Translucent)
END
BUT_ONLY
ADD_PROJECTILE ~override/%Potions_Proj%.pro~
END
Code : Tout sélectionner
// Détection du Mal.
// -----------------
COPY_EXISTING ~INAREA.pro~ ~override/GWInAr25.pro~ // 94-Instant area effect (INAREA) ==> 697 (81') = 25 m
WRITE_SHORT 0x204 256 // 9 m = 30' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 697 // 25 m = 81' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWInAr25.pro~ ~Instant area effect (25 m)~
Code : Tout sélectionner
// Rejet du Chaos - du Mal.
// ------------------------
COPY_EXISTING ~INAREA.pro~ ~override/GWInAr12.pro~ // 94-Instant area effect (INAREA) ==> 341 (39') = 12 m
WRITE_SHORT 0x204 341 // 12 m = 39' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 341 // 12 m = 39' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWInAr12.pro~ ~Instant area effect (12 m)~
// Protection contre le Mal sur 3 m (Épée sainte et Licornes).
// -----------------------------------------------------------
COPY_EXISTING ~INAREAPA.pro~ ~override/GWIAPAIC.pro~ // 158-Instant Area (Party Only) (INAREAPA) ==> 256 (30') = 9 m
WRITE_LONG 0x0c THIS | BIT4 // Sparking flags = bit 4: Do not affect direct target
BUT_ONLY
ADD_PROJECTILE ~override/GWIAPAIC.pro~ ~Instant Area (Party Only, 9 m)~
// Épée sainte protectrice - Beauté aveuglante - Beauté surnaturelle.
// ------------------------------------------------------------------
COPY_EXISTING ~INAREANP.pro~ ~override/GWIANP20.pro~ // 159-Instant Area (Not Party) (INAREANP) ==> 512 (60') = 18 m
WRITE_SHORT 0x204 512 // 18 m = 60' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 512 // 18 m = 60' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWIANP20.pro~ ~Instant Area (Not Party, 18 m)~
// Bénédiction de l'eau : zone d'effet de l'explosion de l'eau bénite.
// --------------------
COPY_EXISTING ~INAREANS.pro~ ~override/GWHlyWat.pro~ // 186-Non sprite Area (INAREANS) ==> 128 (15') = 4,5 m car 43 (5' = 1,5 m) ne touche personne autour.
WRITE_SHORT 0x204 128 // 4,5 m = 15' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 128 // 4,5 m = 15' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWHlyWat.pro~ ~Non sprite Area (5 m)~
// Détection des chausse-trappes.
// ------------------------------
COPY_EXISTING ~INAREANS.pro~ ~override/GWDetPg.pro~ // 186-Non sprite Area (INAREANS) ==> 341 (39') = 12 m
WRITE_SHORT 0x204 341 // 12 m = 39' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 341 // 12 m = 39' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWDetPg.pro~ ~Non sprite Area (12 m)~
Code : Tout sélectionner
// Épée sainte purificatrice.
// --------------------------
COPY_EXISTING ~INAREASM.pro~ ~override/GWIASm20.pro~ // 205-Instant area effect small (INAREASM) ==> 170 (19') = 6 m
WRITE_SHORT 0x204 170 // 6 m = 20' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 170 // 6 m = 20' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWIASM20.pro~ ~Instant area effect small (6 m)~
Code : Tout sélectionner
// Lame - Arc solaire (aveuglement).
// ---------------------------------
COPY_EXISTING ~SMLLNPC.pro~ ~override/GWAr08NP.pro~ // 218-Small Area (Not Party) (SMLLNPC) ==> 75 (8') = 2,5 m
WRITE_SHORT 0x204 75 // 2,5 m = 8' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 75 // 2,5 m = 8' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWAr08NP.pro~ ~Small Area (Not Party, 8')~
Code : Tout sélectionner
// Rayonnement saint.
// ------------------
COPY_EXISTING ~SMLLARNC.pro~ ~override/GWArSm03.pro~ // 216-SmlArea Ignore Center (SMLLARNC) ==> 86 (10') = 3 m
WRITE_SHORT 0x204 86 // 3 m = 10' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 171 // 6 m = 20' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWArSm03.pro~ ~SmlArea Ignore Center (3 m)~
Code : Tout sélectionner
// Festin des Héros - Festin des Champions.
// ----------------------------------------
COPY_EXISTING ~SPARBLPA.pro~ ~override/GWBlPa24.pro~ // 160-Sparkle Area Blue (Party Only) (SPARBLPA) ==> 682 (79') = 24 m
WRITE_SHORT 0x204 682 // 18 m = 60' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 682 // 18 m = 60' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWBlPa24.pro~ ~Sparkle Area Blue (Party Only, 24 m)~
Code : Tout sélectionner
// Silence sur 5 m de Licorne (seulement les ennemis).
// ---------------------------------------------------
COPY_EXISTING ~SPARBLNP.pro~ ~override/GWBlNP05.pro~ // 149-Sparkle Area Blue (SPKLARBL) ==> 150 (17') = 5 m
WRITE_SHORT 0x204 150 // 5 m = 17' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 150 // 5 m = 17' Area of effect (divide by approx 8.5 to receive diameter in feet)
BUT_ONLY
ADD_PROJECTILE ~override/GWBlNP05.pro~ ~Sparkle Area Blue (5 m)~
Plus compliqué : modifier des valeurs des projectiles secondaires, il faut utiliser les adresses suivantes :
Code : Tout sélectionner
0x00212 2 (short) Fragment animation (animate.ids)
0x00214 2 (word) Secondary projectile (projectl.ids-1)
0x00216 1 (byte) Trigger count (used if bits 8 and 9 at 0x200 are not set)
0x00217 1 (byte) Explosion animation (fireball.ids)
0x000218 1 (byte) Explosion colour
0x00021a 2 (bytes) Explosion projectile (projectl.ids), played on affected creatures
0x00021c 8 (resref) Explosion animation (VVC)
0x000224 2 (word) Cone width (1 to 359)
Exemples :
Code : Tout sélectionner
// Pureté de la Nature.
// --------------------
COPY_EXISTING ~NEWBOLT1.pro~ ~override/GWBoltVt.pro~ // 241-New Lightning Bolt (No Bounce) (NEWBOLT1) : vert
WRITE_ASCII 0x136 GWCHLGV2 #8 // Trailing animation 1 (BAM)
ADD_PROJECTILE ~override/GWBoltVt.pro~ ~New Lightning Bolt Green (No Bounce)~
COPY ~%MOD_FOLDER%/Proj/GWPurNa.pro~ ~override/GWPurNa.pro~ // 213-Chain Lightning (LIGHTCHA) Vert + ennemis
SET proj = (IDS_OF_SYMBOL (projectl GWBoltVt) + 1)
WRITE_SHORT 0x21a proj // Explosion projectile (projectl.ids), played on affected creatures
ADD_PROJECTILE ~override/GWPurNa.pro~ ~Chain Lightning Green (Not Party)~
Code : Tout sélectionner
// Rejet du Chaos - du Mal : Projectile.
// -------------------------------------
ACTION_FOR_EACH Rejet_Proj IN ~GWRejCh~ ~GWRejEv~ BEGIN
COPY_EXISTING ~PSPEART.pro~ ~override/%Rejet_Proj%T.pro~ // 233-Energy Spear (PSPEART)
WRITE_SHORT 0x00a 30 // Projectile speed
WRITE_ASCII 0x010 TRA_47 #8 // WAVC file (travelling)
WRITE_ASCIIE 0x104 EVAL "%Rejet_Proj%P" #8 // Projectile animation
WRITE_BYTE 0x133 16 // Not mirrored, not reduced
BUT_ONLY
ADD_PROJECTILE ~override/%Rejet_Proj%T.pro~
END
Code : Tout sélectionner
// Projection de Diamants.
// -----------------------
COPY_EXISTING ~CONECOLD.pro~ ~override/GWPjctDi.pro~ // 250-New Cone of Cold (CONECOLD) ==> 597 (69') = 20 m
WRITE_SHORT 0x204 341 // 12 m = 39' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 597 // 20 m = 69' Area of effect (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x224 120 // Cone width = 120°
PATCH_IF GW_BG2EE = 1 BEGIN
WRITE_LONG 0x2c THIS | BIT0 | BIT1 | BIT30 // Bounce from walls - Pass target - IWD style check
WRITE_SHORT 0x3c 3 // MASK_EVIL
WRITE_SHORT 0x3e 108 // ALIGNEMENT =
WRITE_SHORT 0x40 3 // MASK_EVIL
WRITE_SHORT 0x42 108 // ALIGNEMENT =
END
BUT_ONLY
ADD_PROJECTILE ~override/GWPjctDi.pro~ ~Diamond Spray~
Code : Tout sélectionner
// Vapeur d'épées.
// ---------------
COPY_EXISTING ~CONECOLD.pro~ ~override/GWVapEp.pro~ // 250-New Cone of Cold (CONECOLD) only enemies ==> 341 (39') = 12 m
WRITE_SHORT 0x204 341 // 12 m = 39' Trigger radius (divide by approx 8.5 to receive diameter in feet)
WRITE_SHORT 0x206 341 // 12 m = 39' Area of effect (divide by approx 8.5 to receive diameter in feet)
WRITE_LONG 0x200 THIS | BIT6 // Area projectile flags : ajoute Affect only enemies
WRITE_SHORT 0x210 5 // Explosion delay
WRITE_BYTE 0x218 68 // Explosion colour : 68-Shiny Blue
WRITE_SHORT 0x224 120 // Cone width = 120°
BUT_ONLY
ADD_PROJECTILE ~override/GWVapEp.pro~ ~Sword Stream~