Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //モンブラン
- //ffg's edit
- //some needed globals
- import global u_char globU8[8192] = 0x0;
- import global u_short globU16[4096] = 0x0;
- import global int globU32[2048] = 0x0;
- import global int vaanLicLP = 0x2198;
- import global int asheLicLP = 0x2360;
- import global int franLicLP = 0x2528;
- import global int balthierLicLP = 0x26f0;
- import global int baschLicLP = 0x28b8;
- import global int peneloLicLP = 0x2a80;
- import global u_char allGlobal[65536] = 0x0;
- import global int cursorPos[6] = 0x81c4;
- script help_talk(6)
- {
- function init()
- {
- return;
- }
- //some needed local variables, though I could just go with the available registers
- u_char retval;
- u_char doLoop;
- function message_loop()
- {
- モンブラン.setkutipakustatus(1);
- モンブラン.setunazukistatus(1);
- //intro message
- sysReqew(1, help_talk::welcome_message);
- doLoop = true;
- while (doLoop)
- {
- //ask whether he needs something
- sysReqew(1, help_talk::ask_help);
- switch (ucMBChoiceHelp)
- {
- case 0:
- sysReqew(1, help_talk::handle_money);
- break;
- case 1:
- sysReqew(1, help_talk::handle_items);
- break;
- case 2:
- sysReqew(1, help_talk::handle_license);
- break;
- case 3:
- sysReqew(1, help_talk::handle_ngplus);
- break;
- default:
- doLoop = false;
- continue;
- }
- if (retval) sysReqew(1, help_talk::confirm_message);
- }
- モンブラン.setkutipakustatus(0);
- モンブラン.setunazukistatus(0);
- wait(10);
- return;
- }
- function welcome_message()
- {
- amese(0, 0x10000f6);
- messync(0, 1);
- return;
- }
- u_char ucMBChoiceHelp;
- function ask_help()
- {
- askpos(0, 0, 4);
- ucMBChoiceHelp = aaske(0, 0x10000f7);
- mesclose(0);
- messync(0, 1);
- return;
- }
- u_char ucMBChoiceGil;
- function handle_money()
- {
- askpos(0, 0, 3);
- ucMBChoiceGil = aaske(0, 0x10000f8);
- mesclose(0);
- messync(0, 1);
- switch (ucMBChoiceGil)
- {
- case 0:
- addgill(1000);
- break;
- case 1:
- addgill(10000);
- break;
- case 2:
- addgill(1000000);
- break;
- default:
- retval = false;
- return;
- }
- retval = true;
- return;
- }
- u_char ucMBChoiceIt;
- function handle_items()
- {
- askpos(0, 0, 7);
- ucMBChoiceIt = aaske(0, 0x10000f9);
- mesclose(0);
- messync(0, 1);
- switch (ucMBChoiceIt)
- {
- case 0:
- btlAtelGetAllItems();
- break;
- case 1:
- btlAtelGetAllEquips();
- break;
- case 2:
- btlAtelGetAllMagics();
- break;
- case 3:
- btlAtelGetAllTechs();
- break;
- case 4:
- btlAtelGetAllTgtChips(); //gambits
- break;
- case 5:
- btlAtelGetAllMistCarts(); //espers
- break;
- case 6:
- btlAtelGetAllPrecious(); //key items
- break;
- default:
- retval = false;
- return;
- }
- retval = true;
- return;
- }
- u_char ucMBChoiceLic;
- u_char lastEntry;
- int licenseArr[6] = {
- 0x219c, //vaan
- 0x2364, //ashe
- 0x252c, //fran
- 0x26f4, //balthier
- 0x28bc, //basch
- 0x2a84 //penelo
- };
- u_char levelOffset = 46;
- u_char firstJobOffset = 47;
- u_char secondJobOffset = 48;
- u_char selectedJobOffset = 49;
- u_char licensesCost[362] = {
- 50, 75, 100, 125, 0, 0, 0, 0, //quickenings and unused
- 0, 0, 0, 0, 0, 0, 0, 0, //unused
- 0, 0, 20, 30, 35, 50, 50, 100, //belias-famfrit
- 30, 50, 100, 65, 65, 115, 200, 1, //zalera-starting
- 15, 25, 35, 50, 55, 60, 70, 50, //swords1-bloodsword
- 50, 70, 80, 135, 225, 35, 50, 70, //greatswords-katana3
- 90, 130, 100, 120, 180, 20, 25, 35, //katana4-spears3
- 60, 40, 70, 240, 20, 30, 35, 40, //spears4-poles4
- 50, 90, 20, 30, 35, 45, 60, 70, //poles5-bows6
- 130, 25, 40, 60, 115, 30, 50, 60, //sagittarius-guns3
- 70, 90, 100, 20, 25, 35, 50, 60, //guns4-axes5
- 65, 85, 15, 20, 35, 45, 60, 220, //axes6-mina
- 20, 30, 40, 50, 130, 15, 25, 30, //rods1-staves3
- 40, 115, 30, 40, 60, 65, 50, 40, //staves4-measures1
- 50, 70, 35, 55, 75, 15, 20, 25, //measures2-shields3
- 30, 35, 40, 100, 90, 235, 25, 30, //shields4-heavy2
- 35, 40, 50, 55, 60, 65, 70, 80, //heavy3-heavy10
- 190, 10, 15, 20, 25, 30, 40, 50,
- 60, 70, 75, 80, 90, 10, 15, 20,
- 25, 30, 40, 50, 60, 70, 75, 80,
- 90, 5, 20, 25, 35, 35, 35, 40,
- 45, 30, 40, 45, 60, 60, 70, 70,
- 70, 80, 80, 100, 115, 215, 15, 20,
- 25, 30, 40, 50, 60, 70, 15, 20,
- 25, 30, 40, 50, 60, 70, 20, 30,
- 40, 50, 60, 70, 80, 40, 50, 90,
- 90, 100, 110, 155, 40, 50, 110, 100,
- 120, 165, 100, 30, 30, 30, 30, 65,
- 65, 70, 70, 70, 30, 90, 25, 45,
- 75, 30, 50, 80, 30, 50, 80, 20,
- 30, 70, 20, 35, 70, 20, 35, 70,
- 90, 50, 30, 30, 30, 30, 30, 50,
- 30, 30, 30, 30, 50, 20, 30, 40,
- 50, 60, 15, 20, 25, 30, 35, 40,
- 45, 50, 70, 100, 20, 25, 20, 30,
- 30, 50, 35, 50, 40, 50, 40, 30,
- 30, 40, 30, 50, 30, 70, 40, 50,
- 40, 40, 50, 80, 70, 80, 90, 100,
- 115, 130, 220, 50, 50, 50, 70, 70,
- 70, 70, 100, 100, 100, 100, 50, 50,
- 50, 70, 70, 70, 70, 100, 100, 100,
- 100, 80, 90, 80, 100, 150, 100, 200,
- 120, 100, 60, 180, 90, 200, 190, 175,
- 80, 65, 100, 105, 65, 90, 110, 110,
- 110, 130, 160, 80, 90, 90, 90, 125,
- 30, 0
- };
- function handle_license()
- {
- /*askpos(0, 0, 2);
- ucMBChoiceLic = aaske(0, 0x10000fe);
- mesclose(0);
- messync(0, 1);
- if (ucMBChoiceLic != 0)
- {
- retval = false;
- return;
- }*/
- lastEntry = 0;
- for (regI0 = 0; regI0 < 6; regI0++)
- {
- if (ispartymember(regI0))
- lastEntry++;
- else
- setaskselectignore(0, regI0);
- }
- askpos(0, 0, lastEntry);
- ucMBChoiceLic = aaske(0, 0x10000ff);
- mesclose(0);
- messync(0, 1);
- if (ucMBChoiceLic > 5)
- {
- retval = false;
- return;
- }
- regI2 = 0; //cost to refund
- for (regI0 = 0; regI0 < 46; regI0++)
- {
- for (regI1 = 0; (regI1 < 8) && (regI0*8 + regI1 < 362); regI1++)
- {
- if ((allGlobal[licenseArr[ucMBChoiceLic] + regI0] >> regI1) & 1)
- regI2 = regI2 + licensesCost[regI0*8 +regI1];
- }
- allGlobal[licenseArr[ucMBChoiceLic] + regI0] = 0;
- }
- allGlobal[licenseArr[ucMBChoiceLic] + 3] = 0x80; //starting license
- allGlobal[licenseArr[ucMBChoiceLic] + firstJobOffset] = 0xff;
- allGlobal[licenseArr[ucMBChoiceLic] + secondJobOffset] = 0xff;
- allGlobal[licenseArr[ucMBChoiceLic] + selectedJobOffset] = 0xff;
- cursorPos[ucMBChoiceLic] = 32; //set cursor to starting license
- switch (ucMBChoiceLic)
- {
- case 0:
- regI2 = regI2 - 46; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 11] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 17] = 0x02;
- allGlobal[licenseArr[ucMBChoiceLic] + 34] = 0x10;
- vaanLicLP = vaanLicLP + regI2;
- if (vaanLicLP > 99999) vaanLicLP = 99999;
- break;
- case 1:
- regI2 = regI2 - 111; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 4] = 0x02;
- allGlobal[licenseArr[ucMBChoiceLic] + 14] = 0x20;
- allGlobal[licenseArr[ucMBChoiceLic] + 15] = 0x40;
- allGlobal[licenseArr[ucMBChoiceLic] + 20] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 22] = 0x40;
- asheLicLP = asheLicLP + regI2;
- if (asheLicLP > 99999) asheLicLP = 99999;
- break;
- case 2:
- regI2 = regI2 - 86; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 8] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 17] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 22] = 0x40;
- allGlobal[licenseArr[ucMBChoiceLic] + 23] = 0x40;
- allGlobal[licenseArr[ucMBChoiceLic] + 34] = 0x10;
- franLicLP = franLicLP + regI2;
- if (franLicLP > 99999) franLicLP = 99999;
- break;
- case 3:
- regI2 = regI2 - 86; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 9] = 0x20;
- allGlobal[licenseArr[ucMBChoiceLic] + 17] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 34] = 0x50;
- balthierLicLP = balthierLicLP + regI2;
- if (balthierLicLP > 99999) balthierLicLP = 99999;
- break;
- case 4:
- regI2 = regI2 - 96; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 4] = 0x02;
- allGlobal[licenseArr[ucMBChoiceLic] + 14] = 0x20;
- allGlobal[licenseArr[ucMBChoiceLic] + 15] = 0x40;
- allGlobal[licenseArr[ucMBChoiceLic] + 34] = 0x20;
- baschLicLP = baschLicLP + regI2;
- if (baschLicLP > 99999) baschLicLP = 99999;
- break;
- case 5:
- regI2 = regI2 - 61; //cost of starting licenses
- allGlobal[licenseArr[ucMBChoiceLic] + 11] = 0x04;
- allGlobal[licenseArr[ucMBChoiceLic] + 18] = 0x20;
- allGlobal[licenseArr[ucMBChoiceLic] + 22] = 0x40;
- allGlobal[licenseArr[ucMBChoiceLic] + 34] = 0x40;
- peneloLicLP = peneloLicLP + regI2;
- if (peneloLicLP > 99999) peneloLicLP = 99999;
- break;
- default:
- retval = false;
- return;
- }
- retval = true;
- return;
- }
- u_char ucMBChoiceNgPlus;
- u_char ucMBResetHunt;
- u_char ucMBRemoveParty;
- function handle_ngplus()
- {
- //ask if he is sure
- askpos(0, 0, 1);
- ucMBChoiceNgPlus = aaske(0, 0x10000fb);
- mesclose(0);
- messync(0, 1);
- if (ucMBChoiceNgPlus != 0)
- {//cancel
- retval = false;
- return;
- }
- //ask about hunts
- askpos(0, 0, 1);
- ucMBResetHunt = aaske(0, 0x10000fc);
- mesclose(0);
- messync(0, 1);
- //ask about party
- askpos(0, 0, 1);
- ucMBRemoveParty = aaske(0, 0x10000fd);
- mesclose(0);
- messync(0, 1);
- //perform_new_game_start
- モンブラン.setkutipakustatus(0);
- モンブラン.setunazukistatus(0);
- wait(10);
- ucon();
- fadeout(15);
- stopspotsound();
- pausesestop();
- voicestopall();
- fadesync();
- hideparty();
- //here resetting stuff
- sysReqew(0, ngplus_resets::reset_basic);
- if (ucMBResetHunt == 0)
- sysReqew(0, ngplus_resets::reset_hunts);
- sysReqew(0, ngplus_resets::reset_fix);
- if (ucMBRemoveParty == 0)
- sysReqew(0, ngplus_resets::reset_party);
- else
- sysReqew(0, ngplus_resets::reset_battle);
- //end resetting
- シナリオフラグ = 0x19;
- mapjump(0x479, 1, 0);
- retval = false;
- return;
- }
- function confirm_message()
- {
- amese(0, 0x10000fa);
- messync(0, 1);
- mesclose(0);
- return;
- }
- }
- script ngplus_resets(6)
- {
- function init()
- {
- return;
- }
- function reset_basic()
- {
- globU8[0x302] = 0;
- globU8[0x305] = 0;
- globU8[0x309] = 0;
- globU8[0x310] = 0;
- globU8[0x31a] = 0;
- globU8[0x685] = 0;
- //index = 9a0
- globU32[0x268] = 0;
- //index = 9a4
- globU32[0x269] = 0;
- //index - ash dragon
- globU8[0xa03] = 0;
- //index = a04 - mimc queen, flan, firemane, hydra
- globU32[0x281] = 0;
- //index = a08 - tiamat, daedalus, tyrant, metadragon
- globU32[0x282] = 0;
- //index = a0c - ahriman, rafflesia, mandragoras, humbaba
- globU32[0x283] = 0;
- //index = a10 - fury, elder dragon, gilgamesh1, gilgamesh2
- globU32[0x284] = 0;
- //index = a14 - daemon wall 1, daemon wall 2, bomb king, heavenly dragon
- globU32[0x285] = 0;
- //index = a18 - magic dragon, belias, chaos, zodiark
- globU32[0x286] = 0;
- //index = a1c - cuchulainn, zalera, ffamfrit, hashmal
- globU32[0x287] = 0;
- //index = a20 - shemhazai, matheus, zaromus, exodus
- globU32[0x288] = 0;
- //index = a24 - altema, adramelech, bagamnon, judge
- globU32[0x289] = 0;
- //index = a28 - ghis, cid draklor, cid tower, gabranth tower
- globU32[0x28a] = 0;
- //index = a2c - vayne, hyper vayne, last vayne, antlion
- globU32[0x28b] = 0;
- //index = a30 - gabranth bahamut, mimic crystal green, mimic crystal blue, mimic crystal red - setting crystals to done, since we'll have access to teleport
- globU32[0x28c] = 0;
- //index = a34 - gembu, old dragon, blight, suzaku
- globU32[0x28d] = 0;
- //index = a38 - jing yang, seeq prisoner, garamsythe imperial, vossler
- globU32[0x28e] = 0;
- //index = a3c - judge bergan, darkfire, soul of darkness, soul of saint
- globU32[0x28f] = 0;
- //index = a40 - deathgaze, remora, mice, rogue tomato
- globU32[0x290] = 0;
- //index - reset rogue tomato hunt quest
- globU8[0x1030] = 0xfe;
- //index = a6a
- globU16[0x535] = 1;
- //index = a6c
- globU16[0x536] = 1;
- //index
- globU8[0xa6e] = 1;
- //index - FIXME: test this one completion
- globU8[0xcc7] = 0;
- return;
- }
- function reset_hunts()
- {
- //index - reset hunt quests completion
- globU8[0x1030] = 0;
- //index - reset hunt quests completion
- globU8[0x1031] = 0;
- //index - reset hunt quests completion
- globU8[0x1032] = 0;
- //index - reset hunt quests completion
- globU8[0x1033] = 0;
- //index - reset hunt quests completion
- globU8[0x1034] = 0;
- //index - reset hunt quests completion
- globU8[0x1035] = 0;
- //reset more hunt quest progress -
- //index - reset hunt quest taken
- globU8[0x1010] = 0;
- //index - reset hunt quest taken
- globU8[0x1011] = 0;
- //index - reset hunt quest taken
- globU8[0x1012] = 0;
- //index - reset hunt quest taken
- globU8[0x1013] = 0;
- //index - reset hunt quest taken
- globU8[0x1014] = 0;
- //index - reset hunt quest taken
- globU8[0x1015] = 0;
- //index = 10e4 - hunt progress
- globU32[0x439] = 0;
- //index = 10e8 - hunt progress
- globU32[0x43a] = 0;
- //index = 10ec - hunt progress
- globU32[0x43b] = 0;
- //index = 10f0 - hunt progress
- globU32[0x43c] = 0;
- //index = 10f4 - hunt progress
- globU32[0x43d] = 0;
- //index = 10f8 - hunt progress
- globU32[0x43e] = 0;
- //index = 10fc - hunt progress
- globU32[0x43f] = 0;
- //index = 1100 - hunt progress
- globU32[0x440] = 0;
- //index = 1104 - hunt progress
- globU32[0x441] = 0;
- //index = 1108 - hunt progress
- globU32[0x442] = 0;
- //index = 110c - hunt progress
- globU32[0x443] = 0;
- //index = 1110 - hunt progress
- globU32[0x444] = 0;
- //reset hunt enemy spawns: 0 - not yet (have to pick quest), 1 - spawned, 2 - killed
- //index = a44
- globU32[0x291] = 0;
- //index = a48
- globU32[0x292] = 0;
- //index = a4c
- globU32[0x293] = 0;
- //index = a50
- globU32[0x294] = 0;
- //index = a54
- globU32[0x295] = 0;
- //index = a58
- globU32[0x296] = 0;
- //index = a5c
- globU32[0x297] = 0;
- //index = a60
- globU32[0x298] = 0;
- //index = a64
- globU32[0x299] = 0;
- //index = a68
- globU16[0x534] = 0;
- return;
- }
- function reset_fix()
- {
- //index
- globU8[0x1067] = 0;
- //index - tomato progress
- globU8[0x10e4] = 0;
- //index
- globU8[0x10ea] = 0;
- //index
- globU8[0x1101] = 0;
- //barheim mimic fix
- //index = 9c0
- globU32[0x270] = 0;
- //index = 9c4
- globU32[0x271] = 0;
- //index = 9c8
- globU32[0x272] = 0;
- //index = 9cc
- globU32[0x273] = 0;
- //index = 9d0
- globU32[0x274] = 0;
- //index = 9d4
- globU32[0x275] = 0;
- //index = 9d8
- globU32[0x276] = 0;
- //index = 9dc
- globU8[0x9dc] = 0;
- //leviathan fix
- //index
- globU8[0xa28] = 0;
- //jahara fix
- globU8[0x1104] = 100;
- return;
- }
- function reset_party()
- {
- if (ispartymember(1) == 1)
- removepartymember(1);
- if (ispartymember(2) == 1)
- removepartymember(2);
- if (ispartymember(3) == 1)
- removepartymember(3);
- if (ispartymember(4) == 1)
- removepartymember(4);
- if (ispartymember(5) == 1)
- removepartymember(5);
- removeguestbattlemember(0);
- removeguestbattlemember(1);
- removeguestbattlemember(2);
- removeguestbattlemember(3);
- removeguestbattlemember(4);
- removeguestbattlemember(5);
- removeguestbattlemember(6);
- removeguestbattlemember(7);
- removeguestbattlemember(8);
- removeguestbattlemember(9);
- removeguestbattlemember(10);
- removeguestbattlemember(11);
- removeguestbattlemember(12);
- removeguestbattlemember(13);
- removeguestbattlemember(14);
- removeguestbattlemember(15);
- removeguestbattlemember(16);
- removeguestbattlemember(17);
- removeguestbattlemember(18);
- removeguestbattlemember(19);
- removeguestbattlemember(20);
- removeguestbattlemember(21);
- removeguestbattlemember(22);
- removeguestbattlemember(23);
- setbattlemember(-1, 0, -1); //set van
- showparty();
- return;
- }
- function reset_battle()
- {
- setbattlemember(-1, 0, -1); //set van
- removebattlemember(1);
- removebattlemember(2);
- removebattlemember(3);
- removebattlemember(4);
- removebattlemember(5);
- showparty();
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement