Help for my ¨buy spells scripts¨or at least where to find it

Official forum of the Wake of Gods mod to Heroes of Might and Magic III.

Moderator: Moderators

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Help for my ¨buy spells scripts¨or at least where to find it

Postby Pollo2002 » Dec 9 2010, 9:37

Ive been creating a script so you can buy spells instead of getting random, this is what i got so far.

Code: Select all

ZVSE
AUTO_PoweredBy=ERM Script Editor v.1.2.6.32
!?CM1;
!!CM:I?v1;
!!CM:S?v2;
!!CA-1:T?v3; * Get current castle type *
* String declarations for general use *
!!VRz1:S^Select spell level^;
!!VRz2:S^Level 1^;
!!VRz3:S^Level 2^;
!!VRz4:S^Level 3^;
!!VRz5:S^Level 4^;
!!VRz6:S^Level 5^;
!!VRz7:S^Cancel^;
!!VRz8:S^Back^;
!!VRz9:S^Select spell^;
 
* * * PRICE DECLARATIONS * * *
* Light Spells *
!!VRv110:S500; * Bloodlust *
!!VRv111:S500; * Counterstrike *
!!VRv112:S500; * Shield *
!!VRv120:S1000; * Light *
!!VRv121:S1000; * Precision *
!!VRv122:S1000; * Air Shield *
!!VRv130:S2000; * Haste *
!!VRv131:S2000; * PF Elements *
!!VRv140:S4000; * Prayer *
!!VRv141:S4000; * Fire shield *
!!VRv150:S10000; * Slayer *
!!VRv151:S10000; * Frenzy *
* Pro Castle price modifiers for Light spells *
!!VRv110&v3=0|v3=1/v3=7:*50:100; * v3 = 0 means castle type = Castle *
!!VRv111&v3=0|v3=1/v3=7:*50:100; * v3 = 1 means castle type = Rampart *
!!VRv112&v3=0|v3=1/v3=7:*50:100; * v3 = 7 means castle type = Fortress *
!!VRv120&v3=0|v3=1/v3=7:*50:100;
!!VRv121&v3=0|v3=1/v3=7:*50:100;
!!VRv122&v3=0|v3=1/v3=7:*50:100;
!!VRv130&v3=0|v3=1/v3=7:*50:100;
!!VRv131&v3=0|v3=1/v3=7:*50:100;
!!VRv140&v3=0|v3=1/v3=7:*50:100;
!!VRv141&v3=0|v3=1/v3=7:*50:100;
!!VRv150&v3=0|v3=1/v3=7:*50:100;
!!VRv151&v3=0|v3=1/v3=7:*50:100;
* Negative Castle price modifiers for Light spells *
!!VRv110&v3=6|v3=4/v3=3:*150:100; * v3 = 6 means castle type = Stronghold *
!!VRv111&v3=6|v3=4/v3=3:*150:100; * v3 = 4 means castle type = Necropolis *
!!VRv112&v3=6|v3=4/v3=3:*150:100; * v3 = 3 means castle type = Inferno *
!!VRv120&v3=6|v3=4/v3=3:*150:100;
!!VRv121&v3=6|v3=4/v3=3:*150:100;
!!VRv122&v3=6|v3=4/v3=3:*150:100;
!!VRv130&v3=6|v3=4/v3=3:*150:100;
!!VRv131&v3=6|v3=4/v3=3:*150:100;
!!VRv140&v3=6|v3=4/v3=3:*150:100;
!!VRv141&v3=6|v3=4/v3=3:*150:100;
!!VRv150&v3=6|v3=4/v3=3:*150:100;
!!VRv151&v3=6|v3=4/v3=3:*150:100;
* Dark Spells *
!!VRv113:S500; * Weakness *
!!VRv114:S500; * Disrupting ray *
!!VRv115:S500; * Stoneskin *
!!VRv123:S1000; * Death ripple *
!!VRv124:S1000; * Dark *
!!VRv132:S2000; * Sacrifice *
!!VRv133:S2000; * Slow *
!!VRv134:S2000; * Forgetfulness *
!!VRv142:S4000; * Hypnotize *
!!VRv143:S4000; * Blind *
!!VRv152:S5000; * Resurrection *
!!VRv153:S5000; * Berserker *
* Pro Castle price modifiers for Dark spells *
!!VRv113&v3=6|v3=4:*50:100; * v3 = 6 means castle type = Stronghold *
!!VRv114&v3=6|v3=4:*50:100; * v3 = 4 means castle type = Necropolis *
!!VRv115&v3=6|v3=4:*50:100;
!!VRv123&v3=6|v3=4:*50:100;
!!VRv124&v3=6|v3=4:*50:100;
!!VRv132&v3=6|v3=4:*50:100;
!!VRv133&v3=6|v3=4:*50:100;
!!VRv134&v3=6|v3=4:*50:100;
!!VRv142&v3=6|v3=4:*50:100;
!!VRv143&v3=6|v3=4:*50:100;
!!VRv152&v3=6|v3=4:*50:100;
!!VRv153&v3=6|v3=4:*50:100;
* Negative Castle price modifiers for Dark spells *
!!VRv113&v3=0|v3=1:*150:100; * v3 = 0 means castle type = Castle *
!!VRv114&v3=0|v3=1:*150:100; * v3 = 1 means castle type = Rampart *
!!VRv115&v3=0|v3=1:*150:100;
!!VRv123&v3=0|v3=1:*150:100;
!!VRv124&v3=0|v3=1:*150:100;
!!VRv132&v3=0|v3=1:*150:100;
!!VRv133&v3=0|v3=1:*150:100;
!!VRv134&v3=0|v3=1:*150:100;
!!VRv142&v3=0|v3=1:*150:100;
!!VRv143&v3=0|v3=1:*150:100;
!!VRv152&v3=0|v3=1:*150:100;
!!VRv153&v3=0|v3=1:*150:100;
* Conjure Spells *
!!VRv116:S500; * Remove Obstacle *
!!VRv117:S500; * Quicksand *
!!VRv125:S1000; * Landmine *
!!VRv126:S1000; * Earthquake *
!!VRv127:S1000; * Force field *
!!VRv135:S2000; * Cure *
!!VRv136:S2000; * Clone *
!!VRv144:S4000; * Dispel *
!!VRv145:S4000; * Teleport *
!!VRv146:S4000; * Stone rain *
!!VRv154:S5000; * Implosion *
!!VRv155:S5000; * Fly *
!!VRv156:S5000; * Anti-Magic *
* Pro Castle price modifiers for Conjure spells *
!!VRv116&v3=2:*50:100;  * v3 = 2 means castle type = Tower
!!VRv117&v3=2:*50:100;
!!VRv125&v3=2:*50:100;
!!VRv126&v3=2:*50:100;
!!VRv127&v3=2:*50:100;
!!VRv135&v3=2:*50:100;
!!VRv136&v3=2:*50:100;
!!VRv144&v3=2:*50:100;
!!VRv145&v3=2:*50:100;
!!VRv146&v3=2:*50:100;
!!VRv154&v3=2:*50:100;
!!VRv155&v3=2:*50:100;
!!VRv156&v3=2:*50:100;
* Negative Castle price modifiers for Conjure spells *
!!VRv116&v3=7:*150:100;  * v3 = 7 means castle type = Fortress
!!VRv117&v3=7:*150:100;
!!VRv125&v3=7:*150:100;
!!VRv126&v3=7:*150:100;
!!VRv127&v3=7:*150:100;
!!VRv135&v3=7:*150:100;
!!VRv136&v3=7:*150:100;
!!VRv144&v3=7:*150:100;
!!VRv145&v3=7:*150:100;
!!VRv146&v3=7:*150:100;
!!VRv154&v3=7:*150:100;
!!VRv155&v3=7:*150:100;
!!VRv156&v3=7:*150:100;
* Elemental Spells *
!!VRv118:S500; * Magic Arrow *
!!VRv119:S500; * Firewall *
!!VRv128:S1000; * Icebolt *
!!VRv129:S1000; * Fireball *
!!VRv137:S2000; * Ring of ice *
!!VRv138:S2000; * Summon W *
!!VRv139:S2000; * Summon A *
!!VRz147:S4000; * Lightning bolt^
!!VRz148:S4000; * Inferno *
!!VRz149:S4000; * Summon F *
!!VRz157:S5000; * Armaggedon *
!!VRz158:S5000; * Chain Lightning *
!!VRz159:S5000; * Summon E *
* Pro Castle price modifiers for Elemental spells *
!!VRv118&v3=8|v3=5/v3=3:*50:100;  v3 = 8 means castle type = Conflux
!!VRv119&v3=8|v3=5/v3=3:*50:100;  v3 = 5 means castle type = Dungeon
!!VRv128&v3=8|v3=5/v3=3:*50:100;  v3 = 3 means castle type = Inferno
!!VRv129&v3=8|v3=5/v3=3:*50:100;
!!VRv137&v3=8|v3=5/v3=3:*50:100;
!!VRv138&v3=8|v3=5/v3=3:*50:100;
!!VRv139&v3=8|v3=5/v3=3:*50:100;
!!VRz147&v3=8|v3=5/v3=3:*50:100;
!!VRz148&v3=8|v3=5/v3=3:*50:100;
!!VRz149&v3=8|v3=5/v3=3:*50:100;
!!VRz157&v3=8|v3=5/v3=3:*50:100;
!!VRz158&v3=8|v3=5/v3=3:*50:100;
!!VRz159&v3=8|v3=5/v3=3:*50:100;
* Negative Castle price modifiers for Elemental spells
* Currently none *
* * * END OF PRICE DECLARATIONS * * *
 
* * * SELECTING SPELL * * *
* Function 1. Asks for spell level to add to active castle magic tower.*
!!FU1:P;
* Prompt spell level *
!?FU1;
!!IF&v2=14/v1=0:G1/4/0/z1/z2/0/0/0/0/0/0/0/0/0/0/z7; *Level 1 menu
!!IF&v2=14/v1=1:G1/4/0/z1/z2/z3/0/0/0/0/0/0/0/0/0/z7; *Level 1-2 menu
!!IF&v2=14/v1=2:G1/4/0/z1/z2/z3/z4/0/0/0/0/0/0/0/0/z7; *Level 1-3 menu
!!IF&v2=14/v1=3:G1/4/0/z1/z2/z3/z4/z5/0/0/0/0/0/0/0/z7; *Lvl 1-4 menu
!!IF&v2=14/v1=4:G1/4/0/z1/z2/z3/z4/z5/z6/0/0/0/0/0/0/z7; *Lvl 1-5 menu
* Call the corresponding spell menu according to level selected *
!!FU2&v4=1:P;
!!FU3&v4=2:P;
!!FU4&v4=4:P;
!!FU5&v4=8:P;
!!FU6&v4=16:P;
!!FU:E;
 
* Function 2. Asks for level 1 spell to add to active castle magic tower.*
!?FU2;
* String declarations for level 1 spells *
!!VRz10:S^Light - Bloodlust - %V110^;
!!VRz11:S^Light - Counterstrike - %V111^;
!!VRz12:S^Light - Shield - %V112^;
!!VRz13:S^Dark - Weakness - %V113^;
!!VRz14:S^Dark - Disrupting ray - %V114^;
!!VRz15:S^Dark - Stoneskin - %V115^;
!!VRz16:S^Conjure - Remove Obstacle - %V116^;
!!VRz17:S^Conjure - Quicksand - %V117^;
!!VRz18:S^Elemental - Magic Arrow - %V118^;
!!VRz19:S^Elemental - Firewall - %V119^;
* Prompt level 1 spells *
!!IF:G1/4/0/z9/z10/z11/z12/z13/z14/z15/z16/z17/z18/z19/z8/z7;
!!FU7&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
 
* Function 3. Asks for level 2 spell to add to active castle magic tower.*
!?FU3;
* String declarations for level 2 spells *
!!VRz20:S^Light - Bless - %V120^;
!!VRz21:S^Light - Precision - %V121^;
!!VRz22:S^Light - Air shield - %V122^;
!!VRz23:S^Dark - Death ripple - %V123^;
!!VRz24:S^Dark - Curse - %V124^;
!!VRz25:S^Conjure - Landmine - %V125^;
!!VRz26:S^Conjure - Earthquake - %V126^;
!!VRz27:S^Conjure - Force field - %V127^;
!!VRz28:S^Elemental - Icebolt - %V128^;
!!VRz29:S^Elemental - Fireball - %V129^;
* Prompt level 2 spells *
!!IF:G1/4/0/z9/z20/z21/z22/z23/z24/z25/z26/z27/z28/z29/z8/z7;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
 
* Function 4. Asks for level 3 spell to add to active castle magic tower.*
!?FU4;
* String declarations for level 3 spells *
!!VRz30:S^Light - Haste - %V130^;
!!VRz31:S^Light - PF elements - %V131^;
!!VRz32:S^Dark - Sacrifice - %V132^;
!!VRz33:S^Dark - Slow - %V133^;
!!VRz34:S^Dark - Forgetfulness - %V134^;
!!VRz35:S^Conjure - Cure - %V135^;
!!VRz36:S^Conjure - Clone - %V136^;
!!VRz37:S^Elemental - Ring of ice - %V137^;
!!VRz38:S^Elemental - Summon W - %V138^;
!!VRz39:S^Elemental - Summon A - %V139^;
* Prompt level 3 spells *
!!IF:G1/4/0/z9/z30/z31/z32/z33/z34/z35/z36/z37/z38/z39/z8/z7;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
 
* Function 5. Asks for level 4 spell to add to active castle magic tower.*
!?FU5;
* String declarations for level 4 spells *
!!VRz40:S^Light - Prayer - %V140^;
!!VRz41:S^Light - Fire shield - %V141^;
!!VRz42:S^Dark - Hypnotize - %V142^;
!!VRz43:S^Dark - Blind - %V143^;
!!VRz44:S^Conjure - Dispel - %V144^;
!!VRz45:S^Conjure - Teleport - %V145^;
!!VRz46:S^Conjure - Stone rain - %V146^;
!!VRz47:S^Elemental - Lightning bolt - %V147^;
!!VRz48:S^Elemental - Inferno - %V148^;
!!VRz49:S^Elemental - Summon F - %V149^;
* Prompt level 4 spells *
!!IF:G1/4/0/z9/z40/z41/z42/z43/z44/z45/z46/z47/z48/z49/z8/z7;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
 
* Function 6. Asks for level 5 spell to add to active castle magic tower.*
!?FU6;
* String declarations for level 5 spells *
!!VRz50:S^Light - Slayer - %V150^;
!!VRz51:S^Light - Frenzy - %V151^;
!!VRz52:S^Dark - Resurrection - %V152^;
!!VRz53:S^Dark - Berserker - %V153^;
!!VRz54:S^Conjure - Implosion - %V154^;
!!VRz55:S^Conjure - Fly - %V155^;
!!VRz56:S^Conjure - Anti-Magic - %V156^;
!!VRz57:S^Elemental - Armaggedon - %V157^;
!!VRz58:S^Elemental - Chain Lightning - %V158^;
!!VRz59:S^Elemental - Summon E - %V159^;
* Prompt level 5 spells *
!!IF:G1/4/0/z9/z50/z51/z52/z53/z54/z55/z56/z57/z58/z59/z8/z7;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
* * * END OF SELECTING SPELL * * *


Ok this is nice for menus etc. And the easy part, the hard part is to put the spell once you did the selection. If you try this code you will get the menus and all, but you wont get an effect, because thats the tricky part. note that i made it so that is easy to find and change the spells and whatever text you want.

The following works for Bloodlust, and its so far the only spell its done. The reason is that while it works, i feel is a mess, look how many functions im using for one spell.

If someone knows a more elegant way I could make this work or a forum I could post where I could get help on how to make this more elegant, plz tell me, since whatever I choose to make this work its going to be a lot of work so I need to find the optimal way to make this function in order to be able to continue on this. Thanks

Code: Select all

* * * PUT BLOODLUST INTO MAGIC TOWER * * *
* Function 7. Checks if slots are available for level 1 spells and assigns bloodlust*
 if possible. *
!?FU7;
!!VRy-3:S-1;

!!CA-1:G0/0/?y-3;
!!FU104&y-3=-1:P;
!!FU&v9301=1:E;
!!CA-1&y-3>-1:G0/1/?y-3;
!!FU105&y-3=-1:P;
!!FU&v9301=1:E;
!!CA-1&y-3>-1:G0/2/?y-3;
!!FU106&y-3=-1:P;
!!FU&v9301=1:E;
!!CA-1&y-3>-1:G0/3/?y-3;
!!FU107&y-3=-1:P;
!!FU&v9301=1:E;
!!CA-1&y-3>-1:G0/4/?y-3;
!!FU108&y-3=-1:P;
!!FU&v9301=1:E;
!!FU&y-3>-1:E;

!?FU101;
!!IF:M^You don't have enough resources!^;

!?FU104;
!!VRv9301:S1;
!!OW:C?y-1;
!!OW:Ry-1/6/?y-2;
!!FU101&y-2<500:P;
!!FU&y-2<500:E;
!!CA-1:G0/0/43;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;

!?FU105;
!!VRv9301:S1;
!!OW:C?y-1;
!!OW:Ry-1/6/?y-2;
!!FU101&y-2<500:P;
!!FU&y-2<500:E;
!!CA-1:G0/1/43;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;

!?FU106;
!!VRv9301:S1;
!!OW:C?y-1;
!!OW:Ry-1/6/?y-2;
!!FU101&y-2<500:P;
!!FU&y-2<500:E;
!!CA-1:G0/2/43;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;

!?FU107;
!!VRv9301:S1;
!!OW:C?y-1;
!!OW:Ry-1/6/?y-2;
!!FU101&y-2<500:P;
!!FU&y-2<500:E;
!!CA-1:G0/3/43;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;

!?FU108;
!!VRv9301:S1;
!!OW:C?y-1;
!!OW:Ry-1/6/?y-2;
!!FU101&y-2<500:P;
!!FU&y-2<500:E;
!!CA-1:G0/4/43;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;
!!FU:E;
[/code]

User avatar
Salamandre
Genie
Genie
Posts: 1032
Joined: 13 May 2006
Location: France
Contact:

Postby Salamandre » Dec 9 2010, 17:31

What is the exact thing you want to do? Once build the guild, click right on it and change a spell which is in to another?
Light, conjure, dark? Those are schools for heroes 5, not 3, and using them will confuse the players. Also firewall, counterstrike and many others from first menu are not level 1 spells, but they show as. Please write down exactly what you want.

You are too generous with functions and z vars. Use x vars to pass variables in the same function for all spells of same level and fix the price once the spell was selected, not before. Use z-1->z-10 for all dialogs, the text is assigned to var once you trigger the IF:G dialog and will not overlap.

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Postby Pollo2002 » Dec 10 2010, 1:17

Thanks for your comments.

The reason I used this method to set prices is that I wanted to make it easy for anyone to change the script. So if anyone want to use this script they can, thats why I make so much effort to describe every phase and function.

Conjure, elemental etc, I know there arent in the game, this is a script im doing for my mod, which changes the name of the spheres.

Since Im on it im going to do a thread about my mod.
EDIT: Now I made a thread talking about my mod so you may understand it better

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Postby Pollo2002 » Dec 10 2010, 12:49

I finished my code and its working completly. Now its only left the process of polishing it to look cleaner and tu use better variables and better numbers for functions. But that is ok for now.

Code: Select all

                             ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.10.5.945
ERMS_ScriptDate=9.12(December).2010
ERMS_PoweredBy=ERM Script Editor v.1.2.6.32
!?CM1;
!!CM:I?v1;
!!CM:S?v2;
!!CA-1:T?v3; * Get current castle type *
* String declarations for general use *
!!VRz1:S^Select spell level^;
!!VRz2:S^Level 1^;
!!VRz3:S^Level 2^;
!!VRz4:S^Level 3^;
!!VRz5:S^Level 4^;
!!VRz6:S^Level 5^;
!!VRz7:S^Cancel^;
!!VRz8:S^Back^;
!!VRz9:S^Select spell^;

* * * PRICE DECLARATIONS * * *
* Light Spells *
!!VRv110:S500; * Bloodlust *
!!VRv111:S500; * Counterstrike *
!!VRv112:S500; * Shield *
!!VRv120:S1000; * Light *
!!VRv121:S1000; * Precision *
!!VRv122:S1000; * Air Shield *
!!VRv130:S2000; * Haste *
!!VRv131:S2000; * PF Elements *
!!VRv140:S4000; * Prayer *
!!VRv141:S4000; * Fire shield *
!!VRv150:S10000; * Slayer *
!!VRv151:S10000; * Frenzy *
* Pro Castle price modifiers for Light spells *
!!VRv110&v3=0|v3=1/v3=7:*50:100; * v3 = 0 means castle type = Castle *
!!VRv111&v3=0|v3=1/v3=7:*50:100; * v3 = 1 means castle type = Rampart *
!!VRv112&v3=0|v3=1/v3=7:*50:100; * v3 = 7 means castle type = Fortress *
!!VRv120&v3=0|v3=1/v3=7:*50:100;
!!VRv121&v3=0|v3=1/v3=7:*50:100;
!!VRv122&v3=0|v3=1/v3=7:*50:100;
!!VRv130&v3=0|v3=1/v3=7:*50:100;
!!VRv131&v3=0|v3=1/v3=7:*50:100;
!!VRv140&v3=0|v3=1/v3=7:*50:100;
!!VRv141&v3=0|v3=1/v3=7:*50:100;
!!VRv150&v3=0|v3=1/v3=7:*50:100;
!!VRv151&v3=0|v3=1/v3=7:*50:100;
* Negative Castle price modifiers for Light spells *
!!VRv110&v3=6|v3=4/v3=3:*150:100; * v3 = 6 means castle type = Stronghold *
!!VRv111&v3=6|v3=4/v3=3:*150:100; * v3 = 4 means castle type = Necropolis *
!!VRv112&v3=6|v3=4/v3=3:*150:100; * v3 = 3 means castle type = Inferno *
!!VRv120&v3=6|v3=4/v3=3:*150:100;
!!VRv121&v3=6|v3=4/v3=3:*150:100;
!!VRv122&v3=6|v3=4/v3=3:*150:100;
!!VRv130&v3=6|v3=4/v3=3:*150:100;
!!VRv131&v3=6|v3=4/v3=3:*150:100;
!!VRv140&v3=6|v3=4/v3=3:*150:100;
!!VRv141&v3=6|v3=4/v3=3:*150:100;
!!VRv150&v3=6|v3=4/v3=3:*150:100;
!!VRv151&v3=6|v3=4/v3=3:*150:100;
* Dark Spells *
!!VRv113:S500; * Weakness *
!!VRv114:S500; * Disrupting ray *
!!VRv115:S500; * Stoneskin *
!!VRv123:S1000; * Death ripple *
!!VRv124:S1000; * Dark *
!!VRv132:S2000; * Sacrifice *
!!VRv133:S2000; * Slow *
!!VRv134:S2000; * Forgetfulness *
!!VRv142:S4000; * Hypnotize *
!!VRv143:S4000; * Blind *
!!VRv152:S5000; * Resurrection *
!!VRv153:S5000; * Berserker *
* Pro Castle price modifiers for Dark spells *
!!VRv113&v3=6|v3=4:*50:100; * v3 = 6 means castle type = Stronghold *
!!VRv114&v3=6|v3=4:*50:100; * v3 = 4 means castle type = Necropolis *
!!VRv115&v3=6|v3=4:*50:100;
!!VRv123&v3=6|v3=4:*50:100;
!!VRv124&v3=6|v3=4:*50:100;
!!VRv132&v3=6|v3=4:*50:100;
!!VRv133&v3=6|v3=4:*50:100;
!!VRv134&v3=6|v3=4:*50:100;
!!VRv142&v3=6|v3=4:*50:100;
!!VRv143&v3=6|v3=4:*50:100;
!!VRv152&v3=6|v3=4:*50:100;
!!VRv153&v3=6|v3=4:*50:100;
* Negative Castle price modifiers for Dark spells *
!!VRv113&v3=0|v3=1:*150:100; * v3 = 0 means castle type = Castle *
!!VRv114&v3=0|v3=1:*150:100; * v3 = 1 means castle type = Rampart *
!!VRv115&v3=0|v3=1:*150:100;
!!VRv123&v3=0|v3=1:*150:100;
!!VRv124&v3=0|v3=1:*150:100;
!!VRv132&v3=0|v3=1:*150:100;
!!VRv133&v3=0|v3=1:*150:100;
!!VRv134&v3=0|v3=1:*150:100;
!!VRv142&v3=0|v3=1:*150:100;
!!VRv143&v3=0|v3=1:*150:100;
!!VRv152&v3=0|v3=1:*150:100;
!!VRv153&v3=0|v3=1:*150:100;
* Conjure Spells *
!!VRv116:S500; * Remove Obstacle *
!!VRv117:S500; * Quicksand *
!!VRv125:S1000; * Landmine *
!!VRv126:S1000; * Earthquake *
!!VRv127:S1000; * Force field *
!!VRv135:S2000; * Cure *
!!VRv136:S2000; * Clone *
!!VRv144:S4000; * Dispel *
!!VRv145:S4000; * Teleport *
!!VRv146:S4000; * Stone rain *
!!VRv154:S5000; * Implosion *
!!VRv155:S5000; * Fly *
!!VRv156:S5000; * Anti-Magic *
* Pro Castle price modifiers for Conjure spells *
!!VRv116&v3=2:*50:100;  * v3 = 2 means castle type = Tower
!!VRv117&v3=2:*50:100;
!!VRv125&v3=2:*50:100;
!!VRv126&v3=2:*50:100;
!!VRv127&v3=2:*50:100;
!!VRv135&v3=2:*50:100;
!!VRv136&v3=2:*50:100;
!!VRv144&v3=2:*50:100;
!!VRv145&v3=2:*50:100;
!!VRv146&v3=2:*50:100;
!!VRv154&v3=2:*50:100;
!!VRv155&v3=2:*50:100;
!!VRv156&v3=2:*50:100;
* Negative Castle price modifiers for Conjure spells *
!!VRv116&v3=7:*150:100;  * v3 = 7 means castle type = Fortress
!!VRv117&v3=7:*150:100;
!!VRv125&v3=7:*150:100;
!!VRv126&v3=7:*150:100;
!!VRv127&v3=7:*150:100;
!!VRv135&v3=7:*150:100;
!!VRv136&v3=7:*150:100;
!!VRv144&v3=7:*150:100;
!!VRv145&v3=7:*150:100;
!!VRv146&v3=7:*150:100;
!!VRv154&v3=7:*150:100;
!!VRv155&v3=7:*150:100;
!!VRv156&v3=7:*150:100;
* Elemental Spells *
!!VRv118:S500; * Magic Arrow *
!!VRv119:S500; * Firewall *
!!VRv128:S1000; * Icebolt *
!!VRv129:S1000; * Fireball *
!!VRv137:S2000; * Ring of ice *
!!VRv138:S2000; * Summon W *
!!VRv139:S2000; * Summon A *
!!VRz147:S4000; * Lightning bolt^
!!VRz148:S4000; * Inferno *
!!VRz149:S4000; * Summon F *
!!VRz157:S5000; * Armaggedon *
!!VRz158:S5000; * Chain Lightning *
!!VRz159:S5000; * Summon E *
* Pro Castle price modifiers for Elemental spells *
!!VRv118&v3=8|v3=5/v3=3:*50:100;  v3 = 8 means castle type = Conflux
!!VRv119&v3=8|v3=5/v3=3:*50:100;  v3 = 5 means castle type = Dungeon
!!VRv128&v3=8|v3=5/v3=3:*50:100;  v3 = 3 means castle type = Inferno
!!VRv129&v3=8|v3=5/v3=3:*50:100;
!!VRv137&v3=8|v3=5/v3=3:*50:100;
!!VRv138&v3=8|v3=5/v3=3:*50:100;
!!VRv139&v3=8|v3=5/v3=3:*50:100;
!!VRz147&v3=8|v3=5/v3=3:*50:100;
!!VRz148&v3=8|v3=5/v3=3:*50:100;
!!VRz149&v3=8|v3=5/v3=3:*50:100;
!!VRz157&v3=8|v3=5/v3=3:*50:100;
!!VRz158&v3=8|v3=5/v3=3:*50:100;
!!VRz159&v3=8|v3=5/v3=3:*50:100;
* Negative Castle price modifiers for Elemental spells
* Currently none *
* * * END OF PRICE DECLARATIONS * * *

* * * SELECTING SPELL * * *
* Function 1. Asks for spell level to add to active castle magic tower.*
!!FU1:P;
* Prompt spell level *
!?FU1;
!!IF&v2=14/v1=0:G1/4/0/z1/z2/0/0/0/0/0/0/0/0/0/0/z7; *Level 1 menu
!!IF&v2=14/v1=1:G1/4/0/z1/z2/z3/0/0/0/0/0/0/0/0/0/z7; *Level 1-2 menu
!!IF&v2=14/v1=2:G1/4/0/z1/z2/z3/z4/0/0/0/0/0/0/0/0/z7; *Level 1-3 menu
!!IF&v2=14/v1=3:G1/4/0/z1/z2/z3/z4/z5/0/0/0/0/0/0/0/z7; *Lvl 1-4 menu
!!IF&v2=14/v1=4:G1/4/0/z1/z2/z3/z4/z5/z6/0/0/0/0/0/0/z7; *Lvl 1-5 menu
* Call the corresponding spell menu according to level selected *
!!FU2&v4=1:P;
!!FU3&v4=2:P;
!!FU4&v4=4:P;
!!FU5&v4=8:P;
!!FU6&v4=16:P;
!!FU:E;

* Function 2. Asks for level 1 spell to add to active castle magic tower.*
!?FU2;
* String declarations for level 1 spells *
!!VRz10:S^Light - Bloodlust - %V110^;
!!VRz11:S^Light - Counterstrike - %V111^;
!!VRz12:S^Light - Shield - %V112^;
!!VRz13:S^Dark - Weakness - %V113^;
!!VRz14:S^Dark - Disrupting ray - %V114^;
!!VRz15:S^Dark - Stoneskin - %V115^;
!!VRz16:S^Conjure - Remove Obstacle - %V116^;
!!VRz17:S^Conjure - Quicksand - %V117^;
!!VRz18:S^Elemental - Magic Arrow - %V118^;
!!VRz19:S^Elemental - Firewall - %V119^;
* Prompt level 1 spells *
!!IF:G1/4/0/z9/z10/z11/z12/z13/z14/z15/z16/z17/z18/z19/z8/z7;
!!FU7&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;

* Function 3. Asks for level 2 spell to add to active castle magic tower.*
!?FU3;
* String declarations for level 2 spells *
!!VRz20:S^Light - Bless - %V120^;
!!VRz21:S^Light - Precision - %V121^;
!!VRz22:S^Light - Air shield - %V122^;
!!VRz23:S^Dark - Death ripple - %V123^;
!!VRz24:S^Dark - Curse - %V124^;
!!VRz25:S^Conjure - Landmine - %V125^;
!!VRz26:S^Conjure - Earthquake - %V126^;
!!VRz27:S^Conjure - Force field - %V127^;
!!VRz28:S^Elemental - Icebolt - %V128^;
!!VRz29:S^Elemental - Fireball - %V129^;
* Prompt level 2 spells *
!!IF:G1/4/0/z9/z20/z21/z22/z23/z24/z25/z26/z27/z28/z29/z8/z7;
!!FU8&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;

* Function 4. Asks for level 3 spell to add to active castle magic tower.*
!?FU4;
* String declarations for level 3 spells *
!!VRz30:S^Light - Haste - %V130^;
!!VRz31:S^Light - PF elements - %V131^;
!!VRz32:S^Dark - Sacrifice - %V132^;
!!VRz33:S^Dark - Slow - %V133^;
!!VRz34:S^Dark - Forgetfulness - %V134^;
!!VRz35:S^Conjure - Cure - %V135^;
!!VRz36:S^Conjure - Clone - %V136^;
!!VRz37:S^Elemental - Ring of ice - %V137^;
!!VRz38:S^Elemental - Summon W - %V138^;
!!VRz39:S^Elemental - Summon A - %V139^;
* Prompt level 3 spells *
!!IF:G1/4/0/z9/z30/z31/z32/z33/z34/z35/z36/z37/z38/z39/z8/z7;
!!FU9&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;

* Function 5. Asks for level 4 spell to add to active castle magic tower.*
!?FU5;
* String declarations for level 4 spells *
!!VRz40:S^Light - Prayer - %V140^;
!!VRz41:S^Light - Fire shield - %V141^;
!!VRz42:S^Dark - Hypnotize - %V142^;
!!VRz43:S^Dark - Blind - %V143^;
!!VRz44:S^Conjure - Dispel - %V144^;
!!VRz45:S^Conjure - Teleport - %V145^;
!!VRz46:S^Conjure - Stone rain - %V146^;
!!VRz47:S^Elemental - Lightning bolt - %V147^;
!!VRz48:S^Elemental - Inferno - %V148^;
!!VRz49:S^Elemental - Summon F - %V149^;
* Prompt level 4 spells *
!!IF:G1/4/0/z9/z40/z41/z42/z43/z44/z45/z46/z47/z48/z49/z8/z7;
!!FU10&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;

* Function 6. Asks for level 5 spell to add to active castle magic tower.*
!?FU6;
* String declarations for level 5 spells *
!!VRz50:S^Light - Slayer - %V150^;
!!VRz51:S^Light - Frenzy - %V151^;
!!VRz52:S^Dark - Resurrection - %V152^;
!!VRz53:S^Dark - Berserker - %V153^;
!!VRz54:S^Conjure - Implosion - %V154^;
!!VRz55:S^Conjure - Fly - %V155^;
!!VRz56:S^Conjure - Anti-Magic - %V156^;
!!VRz57:S^Elemental - Armaggedon - %V157^;
!!VRz58:S^Elemental - Chain Lightning - %V158^;
!!VRz59:S^Elemental - Summon E - %V159^;
* Prompt level 5 spells *
!!IF:G1/4/0/z9/z50/z51/z52/z53/z54/z55/z56/z57/z58/z59/z8/z7;
!!FU11&v4<>1024/v4<>2048:P;
* If back was selected, ask for spell level again.*
!!FU1&v4=1024:P;
!!VRv4:S0;
!!FU:E;
* * * END OF SELECTING SPELL * * *

* * * PUT SPELL IN LEVEL 1 MAGIC TOWER * * *
* Function 7. Checks if slots are available for level 1 spells and assigns bloodlust*
 if possible. *
!?FU7;
!!VRy-3:S-1;
!!VRv9301:S-1;
!!VRv5&v4=1:S43;
!!VRv5&v4=2:S58;
!!VRv5&v4=4:S27;
!!VRv5&v4=8:S45;
!!VRv5&v4=16:S47;
!!VRv5&v4=32:S46;
!!VRv5&v4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P;
!!FU&y-2<v6:E;
!!OW:Ry-1/6/y-2;
!!CA-1:G4/y-7/v5;
!!CA-1:G?y-11;
!!VRy-11:Sy-11 -1;
!!CA-1:B2/y-11;
!!CA-1:B6/y-11;



Now im working on a disable Expert magic. (Basically because i dont want mass spells).
Now the first part was easy, which is changing back the change.

Code: Select all

ZVSE
!?BA0;     *PRE-BATTLE TRIGGER
!!FU25:P;

!?BA50;     **PRE-BATTLE TRIGGER FOR REMOTE PC
!!FU25:P;

!?FU25;     *PRE-BATTLE FUNCTION TO REMOVE EXPERT WATER MAGIC

!!BA:H0/?y-1;   **GET ATTACKING AND DEFENDER NUMBERS
!!BA:H1/?y-2;
!!HEy-1:S16/?v35; **GET ATTACKING AND DEFENDER WATER MAGIC LEVEL
!!HEy-2&y-2>=0:S16/?v36;

!!FU&v35=0/v36=0:E; * EXIT IF NO ONE HAS EXPERT WATER MAGIC

!!HEy-1&v35>0:S16/2;   * REMOVE EXPERT WATER MAGIC
!!HEy-2&y-2>=0/v36>0:S16/2;


Now I guess that what I should do is store the change in a variable, and if that variable exist when the battle ends, it gives players with water advanced magic, water expert magic.

User avatar
Salamandre
Genie
Genie
Posts: 1032
Joined: 13 May 2006
Location: France
Contact:

Postby Salamandre » Dec 11 2010, 22:46

I still don't understand what you want with. I built level 1 mage guild, asked for bloodlust for example, nothing happened and I got regular mage guild description. Why you need to demolish the guild and build it again? Just sell the spell to the hero visiting.

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Postby Pollo2002 » Dec 12 2010, 9:27

Ah, yes little detail, you first need to disable all spells in a mage guild. The script only works if the mage guild has no spells in first place. I did it manually changing the sptraits.txt But I guess I should make a script that empty all mage guilds from spells when the map starts.

User avatar
Salamandre
Genie
Genie
Posts: 1032
Joined: 13 May 2006
Location: France
Contact:

Postby Salamandre » Dec 15 2010, 22:36

Indeed:

!?FU1112;
!!UN:J0/x16/1; remove all spells
!#DO1112/0/69/1:P;

Pollo2002
Peasant
Peasant
Posts: 96
Joined: 24 Jan 2006

Postby Pollo2002 » Dec 17 2010, 17:24

Thanks! thats very helpful, I still dont use well the DO, which is extremely useful.


Return to “Wake of Gods”

Who is online

Users browsing this forum: No registered users and 2 guests