Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --TO DO
- --Experience point values.
- local MaxMPAd = 0xC101
- local CurrMPAd = 0xC103
- local MaxHPAd = 0xC105
- local CurrHPAd = 0xC107 --not actual battle HP, that is CurrHP2Ad
- local AgilityAd = 0xC109 -- need to match highest enemy agility to go first
- -- 0-23 AG = 3 steps wide.
- -- 24-35 = 5 steps wide. (+11)
- --25 = 2% per step
- --36-47 = 7 steps wide. (+11)
- --48-59 = 9 steps wide. (+11)
- --60-?? = 11 steps wide.
- local DefenseAd = 0xC10B
- local FireLevel = 0xC10E
- local WindLevel = 0xC10F
- local WaterLevel = 0xC110
- local EarthLevel = 0xC111
- --
- local NumberItems = 0xC112 --Game checks this when you pick up an item I think
- local FirstItemSlot = 0xC113
- local LastItemSlot = 0xC126 -- This may or may not be only indicative?
- local ItemArray = {"Spirit Light","Fresh Bread", "Honey Bread","Healing Potion", "Dragon's Potion","Dew Drop","Mint Leaves","Heroes Drink","Secret Potion","Silent Flute","Celine's Bell","Replica","Giant's Shoes","Silver Amulet","Golden Amulet"} --From ID 1 to 15
- --
- local MelrodeWings = 0xC127 -- 1 if have, 0 if do not have
- local DondoranWings = 0xC128
- local LarapoolWings = 0xC129
- local NormoonWings = 0xC12A
- local LimelinWings = 0xC12B
- local BrannochWings = 0xC12C
- --
- local HaveEarthOrb = 0xC12D -- 0 = do not have, 1 = have
- local HaveWindJade = 0xC12E
- local HaveWaterJewel = 0xC12F
- local HaveFireRuby= 0xC130
- local HaveEletaleBook = 0xC131
- local HaveDarkGaolKey = 0xC132
- local HaveWarriorBadge = 0xC133
- local HaveWarriorStaff = 0xC134
- local HaveWarriorCape = 0xC135
- local HaveOrchestra = 0xC136
- --
- local LotteryInProgress = 0xC137 --0 if no, 1 if waiting for pidgeon, 3 if something in mailbox.
- local SpiritGemstones = 0xC138
- local LotteryStepCounter = 0xC139 --255 steps on overworld until pidgeon comes. If the number is even upon entering the overworld, it will decrease by one
- --
- local HPPercentAd = 0xC13A --Increments on physical attacks and either staff swings or hits.
- local MPPercentAd = 0xC13B -- Increments per spell that connects per enemy
- local AgilityPercentAd = 0xC13C
- --Moving in battle increments this when not running away.
- --It goes up by 10 per step initially, then later 2 per step.
- --Moving diagonally = 20 per step initially
- --Will stop you at 0 on rollover with no carryover.
- local DefensePercentAd = 0xC13D --Increments 3% at a time, rolls over after 102 damage.
- local ElementPercentAd = 0xC13E --Enemies seem to have an experience point value.
- local ExperienceHigh = 0xC13F
- local ExperienceLow = 0xC140
- local BrianLevel = 0xC141
- local XPosHigh = 0xC144
- local XPosLow = 0xC145
- local YPosHigh = 0xC146
- local YPosLow = 0xC147
- --1 step = 8 frames, 1 grid square = 2 steps
- local LotteryItemGoingFor = 0xC455 --You cannot win an item type you already have.
- local LotteryArray = {"Mint Leaves","Healing Potion","Heroes Drink","Spirit Light","Dragon's Potion","Secret Potion","Warrior's Cape","Warrior's Staff","Warrior's Badge","Orchestra"} --starts at index 1
- local BrianInTransit = 0xC45B -- 0 to 7 in movement
- local BrianBattleY = 0xC45C
- local BrianBattleX = 0xC45D
- local InBattle = 0xC464 -- 4 in town/overworld/dungeon, 2 in random battle
- local NumEnemies1 = 0xC588
- local NumEnemies2 = 0xC589
- local MagicBarrierAd = 0xC612
- local NumEnemies3 = 0xCB28 --Objects on screen in battle?
- local BrianAttackEligible = 0xC59B
- local CurrHP2Ad = 0xC5F1 -- BattleHP
- local EnemyState = {}
- local EnemyY = {}
- local EnemyX = {}
- local EnemyType = {}
- local EnemyMaxHPHigh = {}
- local EnemyMaxHPLow = {}
- local EnemyCurrHPHigh = {}
- local EnemyCurrHPLow = {}
- local EnemyAgility = {}
- local EnemyDefense = {}
- local EnemyAtk = {}
- local EnemyElement = {}
- local EnemyItemDrop = {}
- local EnemyExp = {}
- local EnemyExperienceValue = {}
- EnemyState[1] = 0xC615 -- 0 = dead, 1 = alive sometimes, 2 = its turn
- EnemyY[1] = 0xC618
- EnemyX[1] = 0xC619
- EnemyType[1] = 0xC626 --Indicative but not modifiable?
- EnemyMaxHPHigh[1] = 0xC62C
- EnemyMaxHPLow[1] = 0xC62D
- EnemyCurrHPHigh[1] = 0xC62E
- EnemyCurrHPLow[1] = 0xC62F
- EnemyAgility[1] = 0xC631
- EnemyDefense[1] = 0xC633
- EnemyAtk[1] = 0xC635
- EnemyElement[1] = 0xC636 --I think this is right? 3 earth 2 water, 1 = wind, 0 = fire
- EnemyExp[1] = 0xC638
- EnemyItemDrop[1] = 0xC639
- --EnemyExperienceValue
- EnemyState[2] = 0xC653 -- 0 = dead, 1 = alive, 2 = its turn
- EnemyY[2] = 0xC656 --top of sprite, mirrored in 0xCF67
- EnemyX[2] = 0xC657 --left of sprite
- EnemyType[2] = 0xC664
- EnemyMaxHPHigh[2] = 0xC66A
- EnemyMaxHPLow[2] = 0xC66B
- EnemyCurrHPHigh[2] = 0xC66C
- EnemyCurrHPLow[2] = 0xC66D
- EnemyAgility[2] = 0xC66F
- EnemyDefense[2] = 0xC671
- EnemyAtk[2] = 0xC673
- EnemyElement[2] = 0xC674
- EnemyExp[2] = 0xC676
- EnemyItemDrop[2] = 0xC677
- EnemyState[3] = 0xC691
- EnemyY[3] = 0xC694
- EnemyX[3] = 0xC695
- EnemyType[3] = 0xC6A2
- EnemyMaxHPHigh[3] = 0xC6A8
- EnemyMaxHPLow[3] = 0xC6A9
- EnemyCurrHPHigh[3] = 0xC6AA
- EnemyCurrHPLow[3] = 0xC6AB
- EnemyAgility[3] = 0xC6AD
- EnemyDefense[3] = 0xC6AF
- EnemyAtk[3] = 0xC6B1
- EnemyElement[3] = 0xC6B2
- EnemyExp[3] = 0xC6B4
- EnemyItemDrop[3] = 0xC6B5
- local LotteryRNG = 0xD522 --You win the lottery on multiples of 8, not including 0.
- local DefCounterSubAd = 0xD56D --0 to 2, maybe more later?
- local ToNextLevelHigh = 0xD5E8
- local ToNextLevelLow = 0xD5E9
- local BrianInTransit2 = 0xD837
- local StepCounter = 0xD82F --refreshes to 28-43 upon entering a battle.
- --56-86
- local RNG1Ad = 0xD82C --This does battle type and attack damages seemingly. It is part of the time based step counter determination. Changes based on Y position
- local RNG2Ad = 0xD5CD --This represents the amount to be subtracted every 8th frame on the overworld
- --ON THE OVERWORLD OUTSIDE OF BATTLE
- -- 7 out of 8 frames, the RNG1 will decrease by a constant amount from 1 to 255 determined by Y CAMERA position and whether or not you last moved up or down. Up is 19 more than down.
- --On the 8th frame as determined by RNG2, the RNG1 will decrease by the exact value referred to by the value of RNG2 --the emulator can override lua byte setting when this 8th frame occurs.
- --The 8th frame values subtracted are: An example is: Starting with rollover from 0 to 1: 225, 126, 173, 92, 69, 122, 1, 160, (THESE CHANGE BETWEEN AREAS)
- --Moving the camera in the y direction will add 30 if it does not occur on the 8th frame. Up = 30 at start of step, Down = 30 at end of step.
- --INSIDE A DUNGEON OUTSIDE OF BATTLE
- --the RNG1 will decrease by a constant amount from 1 to 255 determined by Y CAMERA POSITION and whether or not you last moved up or down. Up is 19 more than down.
- --Moving the camera in the y direction will add 200 if it does not occur on the 8th frame. Up = 200 at start of step, Down = 200 at end of step.
- --INSIDE A BATTLE:
- --Standing still, the decrement per frame is approximately 212 to 214 depending on the amount of enemies in the battle.
- --If you stand in the escape zone this decrement will go between another exact value dependent on position and exactly 212-214 as the ESC text flashes.
- --Moving around the arena produces specific increments.
- --When enemies move and attack, the RNG behavior is a bit unpredictable.
- local TestByte1 = 0xC126 --198->218
- local TestByte2 = 0xCF8C -- 210-230
- --Healing = 4 water, 3 earth
- --Magic Barrier = 12 earth, 12 fire, 12 wind
- ThisFrameRNG1 = 0
- LastFrameRNG1 = 0
- StepCountTemp = 0
- PrevX = 256*memory.readbyte(XPosHigh) + memory.readbyte(XPosLow)
- PrevY = 256*memory.readbyte(YPosHigh) + memory.readbyte(YPosLow)
- ThisX = 256*memory.readbyte(XPosHigh) + memory.readbyte(XPosLow)
- ThisY = 256*memory.readbyte(YPosHigh) + memory.readbyte(YPosLow)
- BattleX = memory.readbyte(BrianBattleX)
- BattleY = memory.readbyte(BrianBattleY)
- ScreenshotCounter = 0
- --------------------------------------------------------
- --require "gd"
- --snes9xImage = nil;
- --hugeImage = gd.create((1200), (1200));
- --snes9xImage = gd.createFromGdStr(gui.gdscreenshot());
- --gd.copy(hugeImage, snes9xImage, ThisX - BattleX, ThisY - BattleY, 0, 0, snes9xImage:sizeX(), snes9xImage:sizeY());
- --gd.copy(hugeImage, snes9xImage, X, Y, 0, 0, snes9xImage:sizeX(), snes9xImage:sizeY());
- --hugeImage:png("map.png");
- --------------------------------------------------------
- while true do
- --if ScreenshotCounter == 100 then
- --snes9xImage = gd.createFromGdStr(gui.gdscreenshot());
- --gd.copy(hugeImage, snes9xImage, ThisX - BattleX, ThisY - BattleY, 0, 0, snes9xImage:sizeX(), snes9xImage:sizeY());
- ----gd.copy(hugeImage, snes9xImage, X, Y, 0, 0, snes9xImage:sizeX(), snes9xImage:sizeY());
- --hugeImage:png("map.png");
- --ScreenshotCounter = 0
- --end
- --ScreenshotCounter = ScreenshotCounter + 1
- if true then
- ThisX = 256*memory.readbyte(XPosHigh) + memory.readbyte(XPosLow)
- ThisY = 256*memory.readbyte(YPosHigh) + memory.readbyte(YPosLow)
- if PrevX~=ThisX then
- StepCountTemp = StepCountTemp+1
- PrevX = ThisX
- end
- if PrevY~=ThisY then
- StepCountTemp = StepCountTemp+1
- PrevY = ThisY
- end
- gui.text(1,80, StepCountTemp/8)
- end
- if true then
- for i = 1,3 do
- -- if the enemy is not dead, if you are in battle, and there are at least that many enemies
- if ((memory.readbyte(EnemyState[i]) ~= 0) and (memory.readbyte(InBattle) == 2) and (memory.readbyte(NumEnemies1) + 1) > i) then --This still may be bugged.
- --gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) - 19, "#" .. memory.readbyte(EnemyType[i]))
- gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) - 19, i)
- gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) - 10, memory.readbyte(EnemyCurrHPHigh[i])*256 + memory.readbyte(EnemyCurrHPLow[i]))
- gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) - 1, "A" .. memory.readbyte(EnemyAgility[i]))
- --gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) + 8, "D" .. memory.readbyte(EnemyDefense[i]))
- gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) + 8, "E" .. 256*memory.readbyte(EnemyExp[i]-1) + memory.readbyte(EnemyExp[i]))
- if (memory.readbyte(EnemyItemDrop[i]) ~=0) then
- gui.text(memory.readbyte(EnemyX[i]) - 5, memory.readbyte(EnemyY[i]) + 17, "I" .. memory.readbyte(EnemyItemDrop[i]))
- end
- end
- end
- end
- if false then
- --memory.writebyte(HaveEarthOrb,1)
- --memory.writebyte(SpiritGemstones, 10)
- --memory.writebyte(DefenseAd, 50)
- --memory.writebyte(CurrHPAd,199)
- --memory.writebyte(CurrHP2Ad,199)
- --memory.writebyte(CurrMPAd,15)
- --memory.writebyte(MaxHPAd,200)
- --memory.writebyte(StepCounter,3)
- --memory.writebyte(RNG1Ad,240)
- --memory.writebyte(AgilityAd,24)
- --memory.writebyte(RNG2Ad,0)
- --memory.writebyte(RNG2Ad,0)
- end
- LastFrameRNG1 = ThisFrameRNG1
- ThisFrameRNG1 = memory.readbyte(RNG1Ad)
- RNG1Diff = LastFrameRNG1 - ThisFrameRNG1
- if (RNG1Diff < 0) then
- RNG1Diff = 256 + LastFrameRNG1 - ThisFrameRNG1
- end
- if false then
- memory.writebyte(EarthLevel,14)
- memory.writebyte(WaterLevel,8)
- memory.writebyte(FireLevel,12)
- memory.writebyte(WindLevel,12)
- end
- Fire = memory.readbyte(FireLevel)
- Water = memory.readbyte(WaterLevel)
- Earth = memory.readbyte(EarthLevel)
- Wind = memory.readbyte(WindLevel)
- Step = memory.readbyte(StepCounter)
- MaxMP = memory.readbyte(MaxMPAd)
- CurrMP = memory.readbyte(CurrMPAd)
- MaxHP = memory.readbyte(MaxHPAd)
- CurrHP = memory.readbyte(CurrHPAd)
- Agility = memory.readbyte(AgilityAd)
- Defense = memory.readbyte(DefenseAd)
- LotteryStep = memory.readbyte(LotteryStepCounter)
- LotteryProgress = memory.readbyte(LotteryInProgress)
- HPPercent = memory.readbyte(HPPercentAd)
- MPPercent = memory.readbyte(MPPercentAd)
- AgilityPercent = memory.readbyte(AgilityPercentAd)
- DefensePercent = memory.readbyte(DefensePercentAd)
- ElementPercent = memory.readbyte(ElementPercentAd)
- LotteryItemGoing = memory.readbyte(LotteryItemGoingFor)
- DefCounterSub = memory.readbyte(DefCounterSubAd)
- RNG1 = memory.readbyte(RNG1Ad)
- RNG2 = memory.readbyte(RNG2Ad)
- MagicBarrier = memory.readbyte(MagicBarrierAd)
- BattleX = memory.readbyte(BrianBattleX)
- BattleY = memory.readbyte(BrianBattleY)
- if true then
- gui.text(1,50, RNG1)
- gui.text(20,50,"D: " .. RNG1Diff)
- gui.text(1,60, RNG2)
- end
- if MagicBarrier~=0 then
- gui.text(1, 100, "MB " .. (MagicBarrier))
- end
- XPos = 256*memory.readbyte(XPosHigh) + memory.readbyte(XPosLow)
- YPos = 256*memory.readbyte(YPosHigh) + memory.readbyte(YPosLow)
- gui.text(1,0,"X " .. (XPos))
- gui.text(1,10,"Y " .. (YPos))
- gui.text(1,20,"Step " .. Step)
- gui.text(28, 0, "X " .. (BattleX))
- gui.text(28, 10, "Y " .. (BattleY))
- if (LotteryProgress ~= 0) then
- if (LotteryProgress == 1) then
- gui.text(1,30, "Lottery: " .. LotteryStep)
- end
- if (LotteryProgress == 3) then
- gui.text(1,30, "Item in Box")
- end
- gui.text(1,40, LotteryArray[LotteryItemGoing+1])
- end
- if true then
- ElementXBase = 1--top left corner
- ElementYBase = 114
- gui.text(ElementXBase + 7, ElementYBase, Fire)
- gui.text(ElementXBase + 14, ElementYBase + 7, Wind)
- gui.text(ElementXBase, ElementYBase + 7, Earth)
- gui.text(ElementXBase + 7, ElementYBase + 14, Water)
- end
- if true then
- StatXBase = 111
- StatYBase = 88
- gui.text(StatXBase + 33, StatYBase - 10, memory.readbyte(BrianLevel))
- gui.text(StatXBase,StatYBase, memory.readbyte(ExperienceHigh)*256 + memory.readbyte(ExperienceLow) .. "/" .. memory.readbyte(ToNextLevelHigh)*256 + memory.readbyte(ToNextLevelLow))
- gui.text(StatXBase + 33, StatYBase, ElementPercent .. "%")
- gui.text(StatXBase,StatYBase + 10, CurrHP .. "/" .. MaxHP)
- gui.text(StatXBase + 33,StatYBase + 10, HPPercent .. "%")
- gui.text(StatXBase,StatYBase + 20, CurrMP .. "/" .. MaxMP)
- gui.text(StatXBase + 33,StatYBase + 20, MPPercent .. "%")
- gui.text(StatXBase,StatYBase + 30, Agility)
- gui.text(StatXBase + 33,StatYBase + 30, AgilityPercent .. "%")
- gui.text(StatXBase,StatYBase + 40, Defense)
- gui.text(StatXBase + 33,StatYBase + 40, DefensePercent + DefCounterSub .. "%") --This is out of 102%.
- end
- vba.frameadvance();
- end
- --Experience Levels
- --1 20 exp (3 ME = 24)
- --2 25 exp (4 ME)
- --3 30 (+5) (4 ME)
- --4 35 (+10) (5 ME)
- --5 45 exp
- --6 55 exp
- --7 65 exp
- --8 75 (+10)
- --9 85 (+15)
- --10 100 exp
- --11 115 exp
- --12 130 exp
- --13 145 exp
- --14 150 exp
- --15 165 exp
- --16 180 exp
- --17 195 exp
- --18 210 exp
- --19 225 exp
- --20 240 exp
- --21 255 exp
- --22 270 exp
- --23 285 (+15)
- --24 300 (+20)
- --25 320 exp
- --26 340 exp
- --27 360 exp
- --28 380 exp
- --29 400 exp
- --30 420 exp
- --31 440 exp
- --32 460 exp
- --33 480 (+20)
- --34 500 (+25)
- --35 525
- --36 550
- --37 575
- --38 600
- --39 625
- --40 650
- --41 675 (+25)
- --42 700 (+30)
- --43 730
- --44 760
- --45 790
- --46 820
- --47 850
- --48 880
- --49 910
- --50 940
- --51 970 (+30)
- --52 1000 (+50)
- --55 1150 (+50)
- --60 1400 (+50)
- --61 1450 (+50)
- --62 1500 (+50)
- --63 1600 (+100)
- --64 1700 (+100)
- --65 1800 (+100)
- --70 2300 (+100)
- --75 2800 (+100)
- --80 3300 (+100)
- --85 3800 (+100)
- --86 3900 (+100)
- --87 4000 (+100)
- --88 4200 (+200)
- --89 4400 (+200)
- --90 4600 (+200)
- --95 5600 (+200)
- --100 6600 (+200)
- --Big Mouth = 2
- --Were Hare = 2
- --Parassault = 3
- --Bumbershoot = 3
- --Hell Hound = 3
- --Man Eater = 4
- --200 frames to get an overworld spirit almost exactly.
- --Tim, 3 turns with 2 earth, 4 turns with 2 water.
- --Ideally level 1x off random battles before going to dondoran otherwise a level is wasted.
- -- 5-6 wind for Solvaring
- --~12 wind or less for kiliac
- --~15 wind for dragon, more will cut down turns substantially.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement