Page 1 of 1

Bows/Ranged Weapons (LE?) [Resolved]

Posted: Wed Dec 09, 2009 8:14 am
by bolly
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

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

Posted: Wed Dec 09, 2009 9:11 am
by bolly
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

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

Posted: Wed Dec 09, 2009 11:00 am
by John Adams
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. :)

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

Posted: Wed Dec 09, 2009 11:21 am
by bolly
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?

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

Posted: Wed Dec 09, 2009 9:01 pm
by John Adams
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?

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

Posted: Wed Dec 09, 2009 9:50 pm
by Scatman
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.

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

Posted: Wed Dec 09, 2009 10:50 pm
by bolly
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

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

Posted: Wed Dec 09, 2009 11:04 pm
by bolly
The full size image showing my skills can be seen here: http://bolly.freshinc.co.uk/bows.png

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

Posted: Wed Dec 09, 2009 11:10 pm
by Scatman
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

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

Posted: Wed Dec 09, 2009 11:49 pm
by bolly
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!

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

Posted: Fri Aug 06, 2010 7:22 pm
by dragon
Can I ask here? what are different kinds of Axe?

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

Posted: Wed Aug 11, 2010 7:56 am
by John Adams
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.