Weird MySQL error with #spawn/#npcspawn create
I got the latest code from Github and compiled and copied over, and decided to try out #spawn and #npcspawn create and #npcedit, but I am getting the oddest error when using #spawn and #npcspawn create.
I'll make a hotkey or manually type out the #spawn command: Quote:
Quote:
Quote:
Quote:
I tried it both without (above) and with (below) the #npcspawn create extra parameter of 1: Quote:
|
Spawn works like this:
Code:
#spawn [name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] So "WoodElf" Name, Wood Elf Race, Level 25, 0 Material, - Hp, 1 Gender, 0 class, 0 Primary, 0 Secondary, 1 Merchant ID. |
That's close, but #spawn help is saying:
Quote:
I thought maybe class 0 was the problem, since there is no class 0, but changing it to 1 for warrior didn't make a difference. |
Regardless, an additional parameter is not the issue. You're passing the minus symbol (-) as the value for hp, which could be an issue. I know I don't have any issues making NPCs.
|
The minus symbol tells it to calculate the NPC's MaxHP based on its level. It's calculating it to 723, so that feature's working okay.
I'm experimenting with StringFormat and MessageBox now, to figure out when the last arg changes from 28 to an arbitrary value. You know what the weird thing is? I changed the affected line in the source (npc.cpp line 1052) from: Quote:
Quote:
Quote:
Quote:
Quote:
|
Through chatting, KK and I figured out that the code is trying to pass GetRunSpeed() as a float in the format string ("%f"), when it's actually an integer, and my Visual Studio 2013 is b0rking at that mismatch.
Changing that %f to %i in both query format strings fixes the problem. Too weird. |
A couple more glitches in #npc create are causing problems.
spawngroupid and npc_type_id aren't being set in the spawn struct when they're created in the database, so the values for those in the Mob class are zeroes. Fixes with these three new lines: zone/npc.cpp: Quote:
Quote:
|
|
All times are GMT -4. The time now is 07:49 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.