EZ Server

General Category => General Discussion => Topic started by: Fugitive on May 21, 2013, 07:31:13 pm



Title: Holiday Weeked!!!
Post by: Fugitive on May 21, 2013, 07:31:13 pm
This weekend is holiday weekend.

What are the plans for everyone??


What is the plan for Hunter and EZ?!? (nudge nudge know what I mean)



Title: Re: Holiday Weeked!!!
Post by: Xiggie | Stone on May 21, 2013, 07:32:12 pm
My name is Xiggie and I approve of this hint.


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 21, 2013, 07:35:46 pm
Memorial Day Weekend... or my Birthday which is the Holiday? Since both are this weekend!  :P


Title: Re: Holiday Weeked!!!
Post by: Fliker on May 21, 2013, 07:45:25 pm
My name is Xiggie and I approve of this hint.

I too approve since I just looted the last T5 piece I needed. =D


Title: Re: Holiday Weeked!!!
Post by: Fugitive on May 21, 2013, 07:47:30 pm
Memorial Day Weekend... or my Birthday which is the Holiday? Since both are this weekend!  :P

Both!!


Title: Re: Holiday Weeked!!!
Post by: Brokyn on May 21, 2013, 08:06:20 pm
Oh, sure, where was all this manipulation for Victoria Day weekend?  hehe


Title: Re: Holiday Weeked!!!
Post by: Solbash on May 21, 2013, 08:20:09 pm
This weekend is holiday weekend.

What are the plans for everyone??


What is the plan for Hunter and EZ?!? (nudge nudge know what I mean)



It is an EZ tradition to do dbl lewtz on memorial day weekend. At least we have done it for the past two years(i didn't check back any further in the forums for any earlier)


Title: Re: Holiday Weeked!!!
Post by: Chunka on May 21, 2013, 09:18:16 pm
(http://www.hateborne.com/misc/doublelewtz.jpg)


Title: Re: Holiday Weeked!!!
Post by: Brokyn on May 24, 2013, 08:54:49 am
No double loot for end game...???

That's twice in a row Hunter :(


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 24, 2013, 09:19:37 am
Already explained, T7 loot is via perl quest addloot() and not database tables, so thats why.


Title: Re: Holiday Weeked!!!
Post by: Anuli on May 24, 2013, 02:18:58 pm
So.. There is double loot already?


Title: Re: Holiday Weeked!!!
Post by: Sarthin on May 24, 2013, 05:39:17 pm
Gonna be real sweet if we can see DBL in T7+, TOFS and whatnot in the future. Until then, I'm gonna keep farming essences.


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 24, 2013, 06:02:24 pm
Not every mob uses default.pl, some have their own name.pl so that would be a LOT of editing to go back.


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 24, 2013, 07:30:31 pm
Not every mob uses default.pl, some have their own name.pl so that would be a LOT of editing to go back.


that line of Code is the default PL ... it would handle individual bosses as well.  Just gotta add their loot under their NPC_TYPES id


And to turn it on / off would be 1 change of a number inside the default PL  (turning off double loot that is)

I'd do all the copy paste work if you shot the scripts my way... I ain't got much better to do lol




What I am getting at is.... the Default.pl would handle Double loot for the bosses rather than editing all the damn boss scripts.  1 simple value change after the copy / paste work is done



nvm seems default.pl doesnt work for NPCs that have a script :(


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 24, 2013, 07:48:46 pm
Guess you could use... global_npc.pl and at least give bosses double loot heh

Plus I was doing the NPC_TYPES check wrong here is the right way lol



(Inside Global_NPC.pl)
Code:
sub EVENT_SPAWN {
# Zero is off or any number other than 1
my $double_loot = 1;
if ($double_loot==1)
{

if($npc->GetNPCTypeID() == 1209)  # Pack Master Bloodfang
{
quest::addloot(4201,1);  #Add 1 bronze helm
}

}
}

 
Would give at least the bosses double loot heh  (And actually works hand in hand with the pl file that a boss already has)


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 24, 2013, 08:58:51 pm
There are a LOT of npc_name.pl scripts with addloot() now.

Even if someone else did all the copy/paste work for me, I'd still have a ton of files to upload and download via server and email to person, and also would need to verify the code since yes I am paranoid. Would be easy to slip in 1 line of code to make yourself GM powers or free loot.

A real long term solution would be to eventually convert all my addloot() into a custom plugin that I can edit the plugin in 1 spot that would affect all the scripts that use it.

Might actually do this some day when I get enough time and bored. Most of the stuff is in T7, T8, and ToFS for addloot. And of course a little bit in each tier for random essence/spell drops too.


Title: Re: Holiday Weeked!!!
Post by: hateborne on May 24, 2013, 10:05:33 pm
There are a LOT of npc_name.pl scripts with addloot() now.

Even if someone else did all the copy/paste work for me, I'd still have a ton of files to upload and download via server and email to person, and also would need to verify the code since yes I am paranoid. Would be easy to slip in 1 line of code to make yourself GM powers or free loot.

A real long term solution would be to eventually convert all my addloot() into a custom plugin that I can edit the plugin in 1 spot that would affect all the scripts that use it.

Might actually do this some day when I get enough time and bored. Most of the stuff is in T7, T8, and ToFS for addloot. And of course a little bit in each tier for random essence/spell drops too.

You might be able to get dirty and do a 'sed' command to replace addloot() with a block to do exactly that. I'll try to write something up this weekend for you. You should be able to dump it across the entire quests folder (and obviously across each zone). Only kick is that it would require some *nix base or UNIX Utils for Windows.


-Hate


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 24, 2013, 10:19:21 pm
Code:
# AddLoot(itemid, amount, chance) --- Amount is usually 1 unless the item has charges --- chance higher numbers for better loot chances
 sub AddLoot {
my $itemdrop = $_[0];
my $amount = $_[1];
my $chance = $_[2];

#Set to 2 for double lootz!
my $tries = 2;

for($i = 1; $i <= $tries; $i++)
{
my $random_number = int(rand(100)+1);
if($random_number <= $chance)
{
quest::addloot($itemdrop, $amount);
}
}
 }


Code:
#item 1289, 1 charge, 100% chance
plugin::AddLoot(1289, 1, 100);


Will give 100% chance to give item 1289  and since I have $tries set to 2 ... it will try the loot code twice and the NPC will spawn with 2


Seems to work decently... just tested it a bit heh


Or could write something yourself.. but this gives you an idea of what can be done..  (im sure there are other ways too)




Side note ... not rushing you on this or anything.. just shooting out ideas lol   (For next double lootz)


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 25, 2013, 09:50:11 am
Here is the better version I just wrote.... works much easier and allows for random loot from a List of items!


Code:
# AddLoot(amount, chance, @itemarray)  -- array can be 1 item or more!
 sub AddLoot {
my $amount = shift;
my $chance = shift;
my @itemdrop = @_;


#Set to 2 for double lootz!
my $tries = 2;

for($i = 1; $i <= $tries; $i++)
{
my $random_number = int(rand(100)+1);
if($random_number <= $chance)
{
my $itemz = $itemdrop[ rand @itemdrop ];
quest::addloot($itemz, $amount);
}
}
}



Here is how it is being used in a zone... (or an NPC)


Code:
sub EVENT_SPAWN {
my @itemz = ("1001", #Cloth helm
"1002",  #Cloth Veil
"1003",  #Cloth Choker
"1004",  #Cloth Shirt
"1005"); #Cloth Shawl

 plugin::AddLoot(1, 50, @itemz);

}



50% chance to drop 1 of those 5 items ..... also with $tries set to 2 in the Plugin ... it would allow for Double chances (Double lootz)


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 25, 2013, 05:42:48 pm
That code is very strait forward and simple to understand.

Was going to ask for random off list but seems we already thought of that too with array.

Seems it might be worth to go back over my code and re-write stuff. Won't be able to do a mass copy and replace due to chance to drop, and list of items to drop. Still copy and paste will go just as fast here, and future code this will work nicely.

Now double loot off the database tables is like double chance, so a loot that has 50% drop rate might end up dropping 0, 1, or 2 loots. Edit: Perl plugin code should work the same when chance is done inside the plugin instead of outside the plugin.


Title: Re: Holiday Weeked!!!
Post by: Fugitive on May 25, 2013, 05:52:14 pm
/cheer


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 27, 2013, 03:26:09 am
Here is the better version I just wrote.... works much easier and allows for random loot from a List of items!


Code:
# AddLoot(amount, chance, @itemarray)  -- array can be 1 item or more!
 sub AddLoot {
my $amount = shift;
my $chance = shift;
my @itemdrop = @_;


#Set to 2 for double lootz!
my $tries = 2;

for($i = 1; $i <= $tries; $i++)
{
my $random_number = int(rand(100)+1);
if($random_number <= $chance)
{
my $itemz = $itemdrop[ rand @itemdrop ];
quest::addloot($itemz, $amount);
}
}
}



Here is how it is being used in a zone... (or an NPC)


Code:
sub EVENT_SPAWN {
my @itemz = ("1001", #Cloth helm
"1002",  #Cloth Veil
"1003",  #Cloth Choker
"1004",  #Cloth Shirt
"1005"); #Cloth Shawl

 plugin::AddLoot(1, 50, @itemz);

}



50% chance to drop 1 of those 5 items ..... also with $tries set to 2 in the Plugin ... it would allow for Double chances (Double lootz)

So how about if I want to do 1 out of 400 mobs, what chance do I put in?

Might be easier to just put in 1 of X and pass X as parameter.

i.e.  plugin::AddLoot(1, 500, @itemz); would have 1/500 chance to drop the item. Useful when I want to drop an 'average' of 1 item per killing all trash in the zone.

If we do plugin::AddLoot(2, 500, @itemz); then are we going to get 0, 1, or 2 items, or are we going to get 0 or 2 items?

Just need to tweak and rethink the code a bit. Very hopeful we can get it working and implemented by next double loot holiday.


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 27, 2013, 04:11:19 am
So the 500 would be the random sounds like a nice idea... would be a simple tweak


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 27, 2013, 04:20:03 am
I modified the code from above post, tested and working.

Code:
# AddLoot(amount, chance, @itemarray)  -- array can be 1 item or more!
sub EZAddLoot
{
my $amount = shift;
my $chance = shift;
my @itemdrop = @_;

#Set to 2 for double lootz!
my $Double_Loot = 1; # 1 = Normal 1x loot, 2 = Double Loot, etc

for($n = 1; $n <= $amount; $n++)
{
for($i = 1; $i <= $Double_Loot; $i++)
{
my $random_number = int(rand($chance)+1);
if($random_number == 1) # 1/chance to drop
{
my $itemz = $itemdrop[ rand @itemdrop ];
quest::addloot($itemz, 1); # 1 charge
}
}
}
}

Code:
sub EVENT_SPAWN 
{
my @itemz = ("1001", #Cloth helm
"1002",  #Cloth Veil
"1003",  #Cloth Choker
"1004",  #Cloth Shirt
"1005"); #Cloth Shawl

plugin::EZAddLoot(4, 2, @itemz); # Drop 4 from list, 1/2 Chance (50% chance per each of 4 items), from Array

}

Examples for EVENT_SPAWN:

# Drop up to 4 items from the list, 1/2 (aka 50%) Chance each, from Array
# Could drop 0, 1, 2, 3, or 4 items
plugin::EZAddLoot(4, 2, @itemz);

# Drop 1 item from the list, 1/1 (aka 100%) Chance, from Array
# Always drop 1 item from the list
plugin::EZAddLoot(1, 1, @itemz);

# Drop 1 item from the list, 1/500 Chance, from Array
# 1/500 chance to drop 1 item
plugin::EZAddLoot(1, 500, @itemz);

Would this still work in an Array with only 1 item in it? So choose 1 item from list of 1 items? Haven't tested that far yet.


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 27, 2013, 05:17:17 am
Works very nice like that Hunter!


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 27, 2013, 05:30:57 am
Woot!


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 27, 2013, 05:47:59 am
Code:
sub EVENT_SPAWN {
my @itemz = (1001,  #Cloth helm
1002,   #Cloth Veil
1003,   #Cloth Choker
1004,   #Cloth Shirt
1005);  #Cloth Shawl
my @stuff = (1006); #Cloth Cape

 plugin::AddLoot(4, 5, @itemz);
 plugin::AddLoot(1, 1, @stuff);

}


(4x) 1 / 5 Chance to Drop any of those top 5 items

100% chance to drop Cloth Cape (1 dropped)



(http://i574.photobucket.com/albums/ss189/jdub1337/loot.png) (http://s574.photobucket.com/user/jdub1337/media/loot.png.html)



(this is what I was testing while chatting with you in game and it works awesome!)


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 27, 2013, 06:02:12 am
Now to go through my old code and look for addloot to replace with the new code.


Title: Re: Holiday Weeked!!!
Post by: Natedog on May 27, 2013, 07:01:22 am
Now to go through my old code and look for addloot to replace with the new code.


open them all with Notepad ++

Do a search in all open files for "addloot" and bam you got all instances of that so you can easily modify them


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 27, 2013, 07:10:05 am
Lots of npcs in lots of zones aka Lots of files in lots of folders.


Title: Re: Holiday Weeked!!!
Post by: Felony on May 27, 2013, 08:02:10 pm
I would just use a perl script to handle it.


Title: Re: Holiday Weeked!!!
Post by: Hunter on May 29, 2013, 01:12:32 am
I would just use a perl script to handle it.

Actually that might be bad, since I have a lot of if $chance before addloots, need to manually edit,copy,paste.

Seems the numbers in the array don't need to be in quotes either since they are a number and not a string, just tested.

I've started converting stuff over. Will start with T7 today, effective after reboot. Bosses will use the new addloot plugin that was posted in this topic. Also adding new loot, Class Ink's for Hatebornes custom spell recipes. This will currently be 10% off T7 bosses.

Off Topic, after we get Hatebornes Class Ink's dropping in all tier zones, and I've verified prices/stats of vendor components, then will add other vendor components will be made available within the next day or two.

Not sure how we're going to advertise the recipes yet.

So after this next reboot keep me posted how the T7 Bosses are with loot, if seems to be working. Will start converting other tiers soon.