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 * * *
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;