Skip to content

Instantly share code, notes, and snippets.

@jkoppel
Created September 10, 2018 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkoppel/1321b34187e8e03381903b7cdd55b8b8 to your computer and use it in GitHub Desktop.
Save jkoppel/1321b34187e8e03381903b7cdd55b8b8 to your computer and use it in GitHub Desktop.
Documentation
The behavior of the NormalDialog is interesting. The method displays a messagebox but, the contents of the message box are based around a total of 10 parameters. Here is an example:
NormalDialog(msg, DIALOG_OKAY, -1, -1, -1, 0, -1, 0, -1, 0);
The first input is a message with the data type of char, and the remainder of the parameters are integers. Each aspect of the function can be altered by changing those numbers.
Changing the third parameter seems to change the position of the messagebox on a horizontal axis. From what I’ve observed setting the parameter to 0 moves it to the complete left of the screen and setting it to -1 moves it completely to the right. The higher the negative value, the more to the left it moves, and the higher the positive value the more to the right it moves. If you move a messagebox completely off scree it will appear on the opposite side of the screen like something out of pacman.
Changing the fourth parameter moves it on a vertical axis. However on this one -1 lowers the message box and 0 raises it. The higher you set the value in the positive direction, the box will move down on the vertical axis. If you change the integer value below -1 the game will crash…...for some reason.
For the fifth parameter it displays images in the messagebox. The range for this stops at -1. Anything below it causes a crash. The value -1 itself displays no image. Here is an index for each value and the image associated with it:
-1 – no image
0 – Logs -
1 – Mercury -
2 – Iron ore -
3 – Sulfur -
4 – minerals -
5 – gems -
6 – Gold -
7 – Artifacts -
8- Spells -
9 – Players -
10 – Luck
11 – Bad luck
12 – Golden bird with wings up
13 – Golden bird with wings down
14 – EXP
15 – Heroes
16 – causes a crash
17 – Secondary Skills -
18 – Units -
19 – No picture
20 – No picture
21 – No picture
22 – No picture
23 – No picture
24 – No picture
25 – Primary Skills -
The sixth parameter seems to affect the specific aspect of a certain image. For resources, putting the number under the sixth parameter will display the number under the resources (i.e. how much of it there is.). It seems each number in the fifth parameter represents a group of images if you will, for example 7 being artifacts and the individuals numbers of the sixth parameter displaying which of those artifacts does what. The parameter 5 behaves as an image type, whilst parameter 6 behaves as an argument for the imagetype.
On a separate sheet you will find the image type and below it, it’s multiple arguments are cataloged. However, the constants in consts.cpp can be used within LUA scripts, so that the author of the script is not having to look back and forth at this documentation to use it as a reference sheet.
The 7th parameter simply inserts a second image into the messagebox. As expected, the 8th parameter follows much like the sixth and acts as the argument for the imagetype in the 7th parameter. Thus parameters 7 and 8 behave the exact same as 5 and 6
The 9th parameter applies the dialog option “or” between two images. Inserting the value 1 will provide the or dialog option, however any other number will leave the space empty.
Image Arguments writeup
Logs – argument sets amount
Mercury – argument sets amount
Iron ore – argument sets amount
Sulfur – argument sets amount
Minerals – argument sets amount
Gems – argument sets amount
Gold coins – argument sets amount
Artifacts:
0 – Ultimate spell book
1- Ultimate sword
2- Ultimate cloak
3- Ultimate wand
4- Ultimate shield
5- Ultimate staff
6- Ultimate crown
7- Golden goose
8- Arcane Necklace
9- Caster’s bracelet
10- Mage’s ring
11- Witch’s Broach
12- Medal of valor
13- Medal of courage
14- Medal of honor
15- Medal of distinction
16- Fizbin
17- Thunder mace
18- Armored gauntlet
19- Defender healm
20- Giant flail
21- Ballista
22- Stealth Shield
23- Dragon sword
24- Power Axe
25- Divine Breastplate
26- Minor Scroll
27- Major Scroll
28- Superior Scroll
29- Foremost scroll
30- Endless sack
31- Endless Bag
32- Endless Purse
33- Nomad Boots
34- Traveler’s Boots
35- Rabbit’s foot
36- Horseshoe
37- Coin
38- Clover
39- True Compass
40- Sailors Astrolabe
41- Evil Eye
42- Enchanted Hourglass
43- Gold Watch
44- Skullcap
45- Ice cloak
46- Fire Cloak
47- Lightning helm
48- EverCold Icicle
49- Everhot Lava Rock
50- Lightning Rod
51- Snake Ring
52- Ankh
53- Book of Elements
54- Elemental Ring
55- Holy Pendant
56- Pendant of Free will
57- Pendant of life
58- Serenity Pendant
59- Seeing-eye pendant
60- Kinetic pendant
61- Pendant of Death
62- Wand of Negation
63- Golden bow
64- Telescope
65- Statesman’s quill
66- Wizard’s Hat
67- Power Ring
68- Ammo cart
69- Tax Lien
70- Hideous Mask
71- Endless pouch of sulfur
72- Endless Vial of Mercury
73- Endless pouch of gems
74- Endless Cord of Wood
75- Endless cart of ore
76- Endless Pouch of Crystal
77- Spiked Helm
78- Spiked Shield
79- White Pearl
80- Black Pearl
81- Spell book
82- Dummy Black pearl
83- Dummy black pearl 2
84- Dummy black pearl 3
85- Dummy black pearl 4
86- Spell Scroll
87- Arm of the Martyr
88- Breastplate of Anduran
89- Broach of Shielding
90- Battle Garb of Anduran
91- Crystal ball
92- Heart of Fire
93- Heart of Ice
94- Helmet of Anduran
95- Holy Hammer
96- Legendary Scepter
97- MastHead
98- Sphere of Negation
99- Staff of Wizardry
100- Sword Breaker
101- Sword of Anduran
102- Spade of Necromancy
103- Pandora’s box

Spells:

0- Fireball
1- Fireblast
2- Lightning Bolt
3- Chain Lightning
4- Teleport
5- Cure
6- Mass Cure
7- Resurrect
8- Resurrect True
9- Haste
10- Mass Haste
11- Slow
12- Mass Slow
13- Blind
14- Bless
15- Mass bless
16- Stoneskin
17- Steelskin
18- Curse
19- Mass Curse
20- Holy Word
21- Holy shout
22- Anti-Magic
23- Dispel Magic
24- Mass Dispel
25- Magic Arrow
26- Berzerker
27- Armageddon
28- Elemental Storm
29- Meteor Shower
30- Paralyze
31- Hypnotize
32- Cold Ray
33- Cold Ring
34- Disrupting Ray
35- Death Ripple
36- Death Wave
37- Dragon Slayer
38- Blood Lust
39- Animate Dead
40- Mirror Image
41- Shield
42- Mass Shield
43- Summon Earth Elemental
44- Summon Air Elemental
45- Summon Fire Elemental
46- Summon Water Elemental
47- Earthquake
48- View Mines
49- View Resources
50- View Artifacts
51- View Towns
52- View Heroes
53- View All
54- Identity Hero
55- Summon Boat
56- Dimension Door
57- Town Gate
58- Town portal
59- Visions
60- Haunt
61- Set Earth Guardian
62- Set Air Guardian
63- Set Fire Guardian
64- Set Water Guardian
65- Awareness
Players:
Rainbow: argument displays number count
Storm: Argument displays a number count
Gold bird wings up: Number count
Gold bird wings down: number count
Heroes:
Secondary Skills:
0- Pathfinding basic
1- Pathfinding Advanced
2- Pathfinding expert
3- Archery Basic
4- Archery Advanced
5- Archery Expert
6- Logistics Basic
7- Logistics Advanced
8- Logistics Expert
9- Scouting Basic
10- Scouting Advanced
11- Scouting Expert
12- Diplomacy Basic
13- Diplomacy Advanced
14- Diplomacy expert
15- Navigation Basic
16- Navigation Advanced
17- Navigation Expert
18- Leadership Basic
19- Leadership Advanced
20- Leasdership Expert
21- Wisdom Basic
22- Wisdom Advanced
23- Wisdom Expert
24- Mysticism Basic
25- Mysticism Advanced
26- Mysticism Expert
27- Luck Basic
28- Luck Advanced
29- Luck Expert
30- Ballistics Basic
31- Ballistics Advanced
32- Ballistics Expert
33- Eagle Eye Basic
34- Eagle Eye Advanced
35- Eagle Eye Expert
36- Necromancy Basic
37- Necromancy Advanced
38- Necromancy Expert
39- Estates basic
40- Estates Advanced
41- Estates Expert
42- Mage Guild basic
43- Mage Guild Advanced
44- Mage Guild Expert
Unit:
Primary Skills:
0- Attack Skill
1- Defense Skill
2- Spell Power
3- Knowledge
4- Attack Skill (replica)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment