搜索
 找回密码
 加入

[1.298, 1.310] Fixing the Moradon spawn location

Twisted 2011-9-27 21:34:20 1440
This one got lost, couldn't restore it from the cache... so here goes a fresh guide. Hopefully I don't forget to leave anything out! ;)

The reason it resets you back to 311,351/(351,311?) is because it's hardcoded to return there. That is, apart from /town'ing - you can change those in your START_POSITION table.

Firstly, Aujard resets the coordinates when you select your character, so we'll want to skip that check and tell LOAD_USER_DATA (the procedure called when you select a character) to set them instead (otherwise you'll be able to relog anywhere in Moradon and be where you were when you logged out):

So, skip the check by opening up Aujard and patching:
  1. 1.298

  2. 0042555C     EB 1E       JMP SHORT 0042557C
复制代码
  1. 1.310

  2. 004252F3     EB 52       JMP SHORT 00425347
复制代码
Remember to right-click in the code window, and go "Copy to executable" -> "All modifications" -> "Copy all", then right-click in the (new) code window and finally select "Save file" to save changes.

Now open up your LOAD_USER_DATA stored procedure and replace:
  1.         SELECT Nation, Race, Class, HairColor, Rank, Title, [Level], [Exp], Loyalty, Face, City, Knights, Fame, Hp, Mp, Sp, Strong, Sta, Dex, Intel, Cha, Authority, Points, Gold, [Zone], Bind, PX, PZ, PY, dwTime, strSkill, strItem,strSerial, sQuestCount, strQuest, MannerPoint, LoyaltyMonthly FROM    USERDATA WHERE strUserId = @id
复制代码
With:


  1.         DECLARE @Zone tinyint, @PX int, @PZ int

  2.         SELECT @Zone = [Zone], @PX = PX, @PZ = PZ FROM USERDATA WHERE strUserId = @id
  3.         IF (@Zone = 21)
  4.         BEGIN
  5.                 SET @PX = 817 * 100
  6.                 SET @PZ = 423 * 100     
  7.         END

  8.         SELECT Nation, Race, Class, HairColor, Rank, Title, [Level], [Exp], Loyalty, Face, City, Knights, Fame, Hp, Mp, Sp, Strong, Sta, Dex, Intel, Cha, Authority, Points, Gold, @Zone, Bind, @PX, @PZ, PY, dwTime, strSkill, strItem,strSerial, sQuestCount, strQuest, MannerPoint, LoyaltyMonthly FROM    USERDATA WHERE strUserId = @id
复制代码
Now, to fix up any remaining issues, we'll fix up the hardcoded coordinate referenced in Ebenezer. I will set them to 817,423 but for reference, you can change them to whatever you like (an easy way to do this is via the Decimal to Hexadecimal floating point calculator  and the Hexadecimal to Decimal floating point calculator, but you can also learn how to do this manually here should you wish to!).




1.298
  1. 0049AA24     C745 0C 00404C44    MOV DWORD PTR SS:[EBP+C],444C4000
  2. 0049AA2B     C745 10 0080D343    MOV DWORD PTR SS:[EBP+10],43D38000
复制代码
1.310
  1. 00480920     C745 0C 00404C44    MOV DWORD PTR SS:[EBP+C],444C4000
  2. 00480927     C745 0C 0080D343    MOV DWORD PTR SS:[EBP+C],43D38000
复制代码
And you should be done. :)

1 回复

evaydd
2011-9-27 21:34:20
点击查看详情
鸟语!!!!!!!!!!!!!!!!!!!1
高级模式
游客