Log in

View Full Version : #bot archery


v6greenfbird95@yahoo.com
10-17-2009, 01:56 AM
On my server when i attempt the #bot archery command, the client goes linkdead any ideas? or is that command just broken atm

v6greenfbird95@yahoo.com
10-17-2009, 01:03 PM
Just noticed on the servers world output it says bad/expired session key

Drakson
10-19-2009, 02:32 PM
I have the same problem. Check the logs all I see is the zone going down and the server bring it back up.

[10.19. - 13:27:31] [WORLD__CLIENT] Drakson: Entering zone hollowshade (166:0)
[10.19. - 13:27:31] [WORLD__ZONE] [50] [hollowshade] Broadcasting a world time update
[10.19. - 13:27:32] [WORLD__ZONE] [50] [hollowshade] Setting to 'hollowshade' (166:0)
[10.19. - 13:27:32] [WORLD__CLIENT] Drakson: Sending client to zone hollowshade (166:0) at 208.109.124.182:7049
[10.19. - 13:27:32] [WORLD__CLIENT] Drakson: Client disconnected (not active in process)
[10.19. - 13:29:27] [WORLD__ZONELIST] Removing zoneserver #50 at :7049
[10.19. - 13:29:27] [WORLD__ZONELIST] Hold Zones mode is ON - rebooting lost zone
[10.19. - 13:29:27] [WORLD__LAUNCH] zone: dynamic_50 reported state STOPPED (1 starts)
[10.19. - 13:29:37] [WORLD__LAUNCH] zone: dynamic_50 reported state STARTED (2 starts)
[10.19. - 13:29:37] [WORLD__ZONE] New TCP connection from 127.0.0.1:3017
[10.19. - 13:29:37] [WORLD__CONSOLE] New zoneserver #53 from 127.0.0.1:3017
[10.19. - 13:29:37] [WORLD__ZONE] [53] Zone started with name dynamic_50 by launcher zone
[10.19. - 13:29:37] [WORLD__ZONE] [53] Auto zone port configuration. Telling zone to use port 7052

Randymarsh9
12-27-2009, 07:35 PM
I am having this problem on my server as well. When you tell the ranger to use archery, it crashes the zone.

AndMetal
12-28-2009, 04:32 AM
Here's the code:

zone/bot.cpp (http://code.google.com/p/projecteqemu/source/browse/trunk/EQEmuServer/zone/bot.cpp?r=1064#9282)

if(!strcasecmp(sep->arg[1], "archery")) {
if((c->GetTarget() == NULL) || (c->GetTarget() == c) || !c->GetTarget()->IsBot()) {
c->Message(15, "You must target a bot!");
return;
}

Mob *archerbot = c->GetTarget();
if((archerbot->GetClass()==WARRIOR)||(archerbot->GetClass()==PALADIN)||(archerbot->GetClass()==RANGER)||(archerbot->GetClass()==SHADOWKNIGHT)||(archerbot->GetClass()==ROGUE)) {
//const Item_Struct* botweapon = database.GetItem(archerbot->CastToBot()->GetItem(SLOT_RANGE));
const Item_Struct* botweapon = database.GetItem(archerbot->CastToBot()->GetItem(SLOT_RANGE)->item_id);
uint32 archeryMaterial;
uint32 archeryColor;
uint32 archeryBowID;
uint32 archeryAmmoID;
uint32 range = 0;
if(botweapon && (botweapon->ItemType == ItemTypeBow)) {
archeryMaterial = atoi(botweapon->IDFile+2);
archeryBowID = botweapon->ID;
archeryColor = botweapon->Color;
range =+ botweapon->Range;
botweapon = database.GetItem(archerbot->CastToNPC()->GetItem(SLOT_AMMO)->item_id);
if(!botweapon || (botweapon->ItemType != ItemTypeArrow)) {
archerbot->Say("I don't have any arrows.");
archerbot->CastToBot()->SetBotArcheryRange(0);
return;
}
range += botweapon->Range;
archeryAmmoID = botweapon->ID;
}
else {
archerbot->Say("I don't have a bow.");
archerbot->CastToBot()->SetBotArcheryRange(0);
return;
}
if(archerbot->CastToBot()->IsBotArcher()) {
archerbot->CastToBot()->SetBotArcher(false);
archerbot->Say("Using melee skills.");
archerbot->CastToBot()->BotAddEquipItem(SLOT_PRIMARY, archerbot->CastToBot()->GetBotItemBySlot(SLOT_PRIMARY, &TempErrorMessage));

if(!TempErrorMessage.empty()) {
c->Message(13, "Database Error: %s", TempErrorMessage.c_str());
return;
}
//archerbot->SendWearChange(MATERIAL_PRIMARY);
archerbot->CastToBot()->BotAddEquipItem(SLOT_SECONDARY, archerbot->CastToBot()->GetBotItemBySlot(SLOT_SECONDARY, &TempErrorMessage));

if(!TempErrorMessage.empty()) {
c->Message(13, "Database Error: %s", TempErrorMessage.c_str());
return;
}
//archerbot->SendWearChange(MATERIAL_SECONDARY);
archerbot->CastToBot()->SetBotArcheryRange(0);
}
else {
archerbot->CastToBot()->SetBotArcher(true);
archerbot->Say("Using archery skills.");
archerbot->CastToBot()->BotRemoveEquipItem(SLOT_PRIMARY);
//archerbot->SendWearChange(MATERIAL_PRIMARY);
archerbot->CastToBot()->BotRemoveEquipItem(SLOT_SECONDARY);
//archerbot->SendWearChange(MATERIAL_SECONDARY);
archerbot->CastToBot()->BotAddEquipItem(SLOT_SECONDARY, archeryBowID);
archerbot->CastToBot()->SendBotArcheryWearChange(MATERIAL_SECONDARY, archeryMaterial, archeryColor);
archerbot->CastToBot()->BotAddEquipItem(SLOT_PRIMARY, archeryAmmoID);
archerbot->CastToBot()->SetBotArcheryRange(range);
}
}
else {
archerbot->Say("I don't know how to use a bow.");
}
return;
}


Just scanning through, it looks like there may be a spot or 2 that could end up with a null pointer, but adding some debugging code would help to verify.

WildcardX
01-07-2010, 02:45 PM
There is definitely an issue here that crashes the zone when you tell your bot ranger to use archery. I have reproduced this crash and I'll have a fix committed for it later today.

Thank you for reporting it.

WildcardX
01-07-2010, 04:27 PM
I just committed a fix to address this issue. Download at least r1082 from the repo and give it a try.

Lillu
01-07-2010, 04:36 PM
WildcardX, you are a hero. Thanks for all your hard work!

WildcardX
01-07-2010, 06:17 PM
I love your love.

prickle
01-09-2010, 09:43 PM
question out of curiosity, because I haven't tried it since I discovered archery crashed my zone server. Now that it's fixed, will the bots you tell to use archery remember to use archery when you camp and respawn them? Or will you need to tell them to use archery again on respawn?

HHocker
04-28-2010, 03:05 AM
Do these ranger bots need arrows in the apprpriate slot? I hope they do not need arrows. I am getting the rangers to go with the bow but they melee anyway. So they equip it then engage with swords.

Frosef
04-28-2010, 04:12 AM
Do these ranger bots need arrows in the apprpriate slot? I hope they do not need arrows. I am getting the rangers to go with the bow but they melee anyway. So they equip it then engage with swords.

From my testing they have the Endless Quiver AA from the getgo, I gave my Ranger bot a bow and single arrow, and the arrow never disappeared.

HHocker
04-29-2010, 01:59 AM
Figures it would be so simple. Haha, thanks