Question on payed resources.

Tasanar

Admin
ServUO Developer
Oct 16, 2014
4,679
188
63
33
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
I guess I ment with like the powerhour addition. Looks awesome, just wondering if an issue comes up, and I report, it will get looked at.

Also where is the newest download for Vita Nex
[doublepost=1484605833][/doublepost]The powerhour one, I guess I am curious how much code I will need to write to apply it to loot.

I do not mind paying just want to know a little more about it.
 

Vorspire

Vita-Nex: Core
Admin
ServUO Developer
Jul 29, 2013
1,168
274
83
33
United Kingdom
core.vita-nex.com
Shard Name
Ultima Shards: Multiverse
Donate
Donate money to this user
All of my work published in the Vita-Nex: Core resources section will be supported by me.
ServUO now has a Vita-Nex: Core subforum dedicated to discussion and support (just scroll down a bit).

The Power Hour module requires only one line of code as stated in the resource description, here's a real-world example of how to use it:
Code:
public override void OnKilledBy( Mobile m )
{
	base.OnKilledBy( m );

	if( VitaNex.Modules.PowerHour.PowerHour.HasPowerHour( m ) )
	{
		m.Backpack.DropItem( new BonusLootItem() );
	}
}
Or how about a little more complexity:
Code:
public override void OnKilledBy( Mobile m )
{
	base.OnKilledBy( m );

	double chance = 0.20; // Base 20% chance

	if( VitaNex.Modules.PowerHour.PowerHour.HasPowerHour( m ) )
	{
		chance += 0.30; // Increase chance by 30%
	}

	if( Utility.RandomDouble( ) < chance )
	{
		m.Backpack.DropItem( new BonusLootItem() );
	}
}
I can assure you that the Power Hour module has been used for quite some time now and over the span of 3 shards without any issues, so the only help you'll likely need is more of these examples :)

If your script has the following code:
Code:
using VitaNex.Modules.PowerHour;
You don't need to qualify HasPowerHour() calls with the namespace.
HasPowerHour is also an extension method, so it can be called like this:
Code:
public override void OnKilledBy( Mobile m )
{
	base.OnKilledBy( m );

	if( m.HasPowerHour( ) )
	{
		m.Backpack.DropItem( new BonusLootItem() );
	}
}
 

Tasanar

Admin
ServUO Developer
Oct 16, 2014
4,679
188
63
33
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
Won't let me purchase with paypal. I am positive the email is correct. I use paypal actively.
 

Vorspire

Vita-Nex: Core
Admin
ServUO Developer
Jul 29, 2013
1,168
274
83
33
United Kingdom
core.vita-nex.com
Shard Name
Ultima Shards: Multiverse
Donate
Donate money to this user
Looking into it, they haven't sent me any emails or messages. I may have to find another provider :(

[EDIT] Should be fixed now. Apparently I had to add USD as a currency to my PayPal account! /wrists
 

Tasanar

Admin
ServUO Developer
Oct 16, 2014
4,679
188
63
33
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
Purchased, thanks!

Just one last question - The examples you gave would even apply to sheep, or players summons, or ect. I know you were just giving a quick example. How would I make it apply to only stuff a player killed, that normally drops gold? Maybe an edit in Lootpack.cs?

Could you possible make a separate support form for questions in regards to resources posted? That way I am not flooding this and maybe other people, who use the addon, could suggest ideas.
[doublepost=1484659774][/doublepost]Just support to get it to work for skills would be great
 

Vorspire

Vita-Nex: Core
Admin
ServUO Developer
Jul 29, 2013
1,168
274
83
33
United Kingdom
core.vita-nex.com
Shard Name
Ultima Shards: Multiverse
Donate
Donate money to this user
Thanks!

The problem with modifying gold loot is that there is no perfect way to do it.

You would more than likely need to find all gold on a corpse upon death, find out who killed the mob, and use that info to offset the gold stack amounts in the corpse container. Best place to do this would be near the end of BaseCreature.OnDeath
 

Tasanar

Admin
ServUO Developer
Oct 16, 2014
4,679
188
63
33
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
What if in Lootpack.cs I put

if( VitaNex.Modules.PowerHour.PowerHour.HasPowerHour( m ) ) before all the loot tables

Code:
public static readonly LootPack SePoor =
new LootPack(
new[]
{
new LootPackEntry(true, Gold, 100.00, "2d10+20"), new LootPackEntry(false, AosMagicItemsPoor, 1.00, 1, 5, 0, 100),
new LootPackEntry(false, Instruments, 0.02, 1), new LootPackEntry(true, Gold, 100.00, "2d10+20") // gold added twice
});
Add the gold entry twice

and then the ELSE

and just repeat them all again but for people without powerhour?

Do you see an issue with my trying this route? This is already what I am working on code wise. May be looking too deep into it.
 

Tasanar

Admin
ServUO Developer
Oct 16, 2014
4,679
188
63
33
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
How about for the skill gain then?

SkillCheck.cs just adding that before the old math and than an else for the new math?

What is the best file to start looking at to implement this. I will do the heavy lifting, at least try too, just need to be pointed in the right direction.
 

Vorspire

Vita-Nex: Core
Admin
ServUO Developer
Jul 29, 2013
1,168
274
83
33
United Kingdom
core.vita-nex.com
Shard Name
Ultima Shards: Multiverse
Donate
Donate money to this user
Im not at my computer right now, but i will reply with detail as soon as i am. I will likely reupload the PowerHour module with a couple of relevant EventSink subscriptions. You will be notified by SellFy and will be able to get the new package at no extra cost.