Bows/Ranged Weapons (LE?) [Resolved]

This forum is for problems that arise with the Database Schema as it is developed, or questions you have regarding how to utilize the database.

Moderator: Team Members

Forum rules
Make sure your questions are detailed, intelligent, and relating to the default EQ2Emulator Database Schema.

Questions about how to build your own custom server content will not be addressed here.
Post Reply
bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 8:14 am

Hey there, is ranged in any state of use at the moment? I tried having a mess around with it today but noticed I couldn't equip the item. Took a look at the source where the message was for 'you can't equip this item' is and noticed there was no check for IsRanged(), added it to see but nothing fires. Do i need to set them up in a specific way or are they not in yet? There looks to be alot of ranged code

Thanks in advance

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 9:11 am

if(weapon && ammo)

made all the difference :-P (no messages yet?)

also got stuck on if(weapon->ranged_info->range_low <= distance && (weapon->ranged_info->range_high + ammo->thrown_info->range) >= distance){

looks like my min range was the other problem

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by John Adams » Wed Dec 09, 2009 11:00 am

If you cannot equip and item, make sure your character has the proper skill to use the item you are equipping. Having ammo should not prevent you from putting the item on your char.

Ranged was working for me after it was implemented a few mos ago. I even saw arrows sticking out of mobs I shot at. :)

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 11:21 am

Can you paste me some samples? Maybe i'm doing something wrong, i had to hack in a IsRanged() into Player::CanEquipItem just to wear it

Notice the skill checks after the if for IsXXXXX(); (I added isranged() - i think this is where i'm going wrong)

Code: Select all

bool Player::CanEquipItem(Item* item) {
	if (item) {
		Client* client = GetZone()->GetClientBySpawn(this);
		if (client && (item->IsArmor() [b]|| item->IsRanged()[/b] || item->IsWeapon() || item->IsFood() || item->IsBauble() || item->IsAmmo() || item->IsThrown())) {
			if ((item->generic_info.skill_req1 == 0 || item->generic_info.skill_req1 == 0xFFFFFFFF || skill_list.HasSkill(item->generic_info.skill_req1)) && (item->generic_info.skill_req2 == 0 || item->generic_info.skill_req2 == 0xFFFFFFFF || skill_list.HasSkill(item->generic_info.skill_req2))) {
				int16 override_level = item->GetOverrideLevel(GetAdventureClass(), GetTradeskillClass());
				if (override_level > 0 && override_level <= GetLevel())
					return true;
				if (item->CheckClass(GetAdventureClass(), GetTradeskillClass()))
					if (item->CheckLevel(GetAdventureClass(), GetTradeskillClass(), GetLevel()))
						return true;
					else
						client->Message(CHANNEL_COLOR_RED, "You must be at least level %lu to equip \\aITEM %lu 0:%s\\/a.", item->generic_info.adventure_default_level, item->details.item_id, item->name.c_str());
				else
					client->Message(CHANNEL_COLOR_RED, "Your class may not equip \\aITEM %lu 0:%s\\/a.", item->details.item_id, item->name.c_str());
			}
			else
				client->SimpleMessage(0, "You lack the skill required to equip this item.");
		}
		else
			client->Message(0, "Item %s isn't equipable.", item->name.c_str());
	}
	return false;
}
All i get is a throw at the moment as the animation, maybe i'm missing something?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by John Adams » Wed Dec 09, 2009 9:01 pm

I don't think it's that complex. What I meant was, add the skill ID from the Skills table to the character_skills for that character (you can do this in-game by typing /skill add I think).

To know what skill to add, simply look at the item (examine). It should show the skill needed to equip the item (al la Piercing, Great Axe, Ranged, etc). If your character does not have that skill (because many of our starting_skills are missing), add it and you can equip the ranged item.

Now to shoot it, well... yes you need ammo =) but tossing a stack of arrows in the Ammo slot (or a ammo bag I believe) will fire when you click Ranged Attack.

What samples are you looking for? There should be nothing in C++ or LUA needed to make Ranged work - unless I am forgetting something.

Scat?

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by Scatman » Wed Dec 09, 2009 9:50 pm

Nope. A lot of the items from live require two skills and we usually are missing one for characters that have to be added. Bows might be the two skills "ranged' and 'bow' or something. The error messages from game will tell you what's wrong. Let me know if you can't get it to work.

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 10:50 pm

John Adams wrote:I don't think it's that complex. What I meant was, add the skill ID from the Skills table to the character_skills for that character (you can do this in-game by typing /skill add I think).

To know what skill to add, simply look at the item (examine). It should show the skill needed to equip the item (al la Piercing, Great Axe, Ranged, etc). If your character does not have that skill (because many of our starting_skills are missing), add it and you can equip the ranged item.

Now to shoot it, well... yes you need ammo =) but tossing a stack of arrows in the Ammo slot (or a ammo bag I believe) will fire when you click Ranged Attack.

What samples are you looking for? There should be nothing in C++ or LUA needed to make Ranged work - unless I am forgetting something.

Scat?
Hey, thanks for the reply both of you - what i was after was your sample two items (bow and arrow), item_details_ranged and item_details_thrown.

So how come the equip item code doesn't check for IsRanged() on the bow equip? Is it checked somewhere else as well where it does incorporate the skill? I have removed the IsRanged() check that I added and here is what I get:

Image

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 11:04 pm

The full size image showing my skills can be seen here: http://bolly.freshinc.co.uk/bows.png

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by Scatman » Wed Dec 09, 2009 11:10 pm

Keep the IsRanged() check in there. IsWeapon doesn't include ranged weapons so we'll need it. I've committed the change and it'll be on public SVN too. So you have 'Ranged'. Try adding 'Bow' as well. You can do /skill add Bow in game or if you want to do it through the db, the skill ID is 1743366740. We've gotten this to work before, just need to figure what we're doing wrong :P

bolly
Retired
Posts: 389
Joined: Mon Sep 21, 2009 3:03 pm
Location: Leeds, UK

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by bolly » Wed Dec 09, 2009 11:49 pm

I added Bow but still the same without the IsRanged(), i can't add isranged() back in at the moment because of that issue with command types and i don't keep different revisions of source code - unless i can somehow pull a specific revision out of svn? Would be interested to know how to do that but I guess that's off topic!

dragon
Posts: 1
Joined: Fri Aug 06, 2010 7:20 pm

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by dragon » Fri Aug 06, 2010 7:22 pm

Can I ask here? what are different kinds of Axe?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Bows/Ranged Weapons (LE?) [Resolved]

Post by John Adams » Wed Aug 11, 2010 7:56 am

dragon wrote:Can I ask here? what are different kinds of Axe?
You might check your `skills` table, for any skill with a name "axe", and that should show you the different types of axes in EQ2.

FWIW, the emulator is no different than LIVE in that respect. Searching the SOE data (or fan sites) will give you that info, too.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests