Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2012, 10:49 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default Kings and Bandits Source / Windows Compiles

I have the source and compiled exes for Windows available for Kings and Bandits. You may have interest in this if you are looking to add new items in during gameplay, team-based pvp systems, generating random names for items/npcs, or pvp leaderboards for certain pvp/pve designs. There is also a dual login server feature that allows you to sync accounts in game.

I will try to add more details as time goes on for now I am releasing the links (plus there are some additional notes included in the zip).

I broke it down into multiple files due to some being large (Such as maps).

Source + Compiled Exes (Build dir) + Quests


Kings Server Database (Includes the custom tables and also some random items already generated)

Item Editor (Support for creating Random Item Templates (min/max) against existing items, also random names used in random items or npc names)
Event Viewer (Updated to work a bit better, was used for showing pop counts in eventlog as well)
KBTools (C# Tools)


EQ Maps
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #2  
Old 03-18-2012, 03:50 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Quote:
Originally Posted by image View Post
I have the source and compiled exes for Windows available for Kings and Bandits. You may have interest in this if you are looking to add new items in during gameplay, team-based pvp systems, generating random names for items/npcs, or pvp leaderboards for certain pvp/pve designs. There is also a dual login server feature that allows you to sync accounts in game.

I will try to add more details as time goes on for now I am releasing the links (plus there are some additional notes included in the zip).

I broke it down into multiple files due to some being large (Such as maps).

Source + Compiled Exes (Build dir) + Quests


Kings Server Database (Includes the custom tables and also some random items already generated)

Item Editor (Support for creating Random Item Templates (min/max) against existing items, also random names used in random items or npc names)
Event Viewer (Updated to work a bit better, was used for showing pop counts in eventlog as well)
KBTools (C# Tools)

EQ Maps
Might merge support for the random item feature into SVN if it's good enough. Do you remember what EQEmu revision this was made against?
Reply With Quote
  #3  
Old 03-18-2012, 12:42 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

The last changelog entry was feb 24 2011 so I am guessing r1873. I did include some additional fixes that were added later on. Most changes for the random items should be within EmuShareMem and in the SharedDatabase class.

Just to add if anyone has any code questions please feel free to ask. I know there are a lot of side implementations that may interest some (like the ones mentioned above, there are more such as character achievements for PVP, eg. reaching certain kills/deaths and you get some coin and recognition in-game, just hard to remember each implementation).
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #4  
Old 03-18-2012, 02:03 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

I pulled the code changelog from the db, there are three revisions that were added, 1882, 1883 and 1890.

KaB/red69 changelog
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #5  
Old 03-28-2012, 09:22 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

Basic Quest Examples for the KaB extensions available thus far

Create loot for NPC after spawn
The sub EVENT_SPAWN is called before we can properly instantiate random loot - it is important that you have a timer call and in the EVENT_TIMER

check and call AddLootGroup(rndlootgroupid) against the $npc pointer.
Try to use unique timer names for each quest file.
Code:
sub EVENT_SPAWN {
quest::settimer("createboneloot",1);
}

sub EVENT_TIMER {
if ( $timer eq "createboneloot" ) { quest::stoptimer("createboneloot"); 

$npc->AddLootGroup(16); }
}
Create a team-based guard
Quest scripts should always be created at the zone level, the name or npc id will work.

Team guards must be set on spawn and if you wish to reset any guard card statistics given to the NPC they must be reset on death. The statistics are saved in the team_guards table in the database.

an example script would include:

Code:
	sub EVENT_SPAWN
	{
	#teamid represents any of the created team id's (1-4 by default).
	#each npc should be unique in-game that attributes an npcid
	#any duplicate npc's in the world will conflict with each other.
	#each team can use the npcid once and provide unique stats.
         
		quest::loadguardtype(teamid, npcid);
	}
Code:
	sub EVENT_DEATH
	{
	        #if you wish to remove any guard card stats given by players
		#issue the quest command below
		quest::resetguardfields(teamid, npcid);
	}
Get a guard's current bonus statistic value

Code:
	sub SUB_WHATEVER
	{
                #quest::getguardfield(teamid, npcid, fieldname)
		#fieldname options: hp, mana, hpregen, manaregen, level, ac
		$value = quest::getguardfield(1, 2093, "*fieldname*");

		quest::say("I have $value of something!");
	}

Check player's PVP value

Code:
	sub SUB_WHATEVER
	{
#GetPVPFlag returns a value of their team id, typically 1-4
#0 is returned if they are neutral
		if ($client->GetPVPFlag() > 0) #check if they are pvp enabled
		{
			quest::say("Go find a fight!");
		}
		else
		{
			quest::say("You are neutral..");
		}
	
	}

Check if player is king of a team

Code:
	sub SUB_WHATEVER
	{
                #IsKing returns a value of 1 if they are a king, 0 if not.
		if ($client->IsKing() > 0) #check if they are pvp enabled
		{
			quest::say("You are a king!");
		}
		else
		{
			quest::say("You are peasant!");
		}
	
	}

Set player's PVP flag

Code:
	sub SUB_WHATEVER
	{
		#0 is for neutral
		#1-4 is for teams, 5 is for bandits (ffa)
		quest::pvpvalue("5");
	}


Get team statistics

Code:
	sub SUB_WHATEVER
	{
		#0 is for neutral
		#1-4 is for teams, 5 is for bandits (ffa)

		my $qeynosBonus = quest::getteamexpbonus(1);
		#team xp bonus returns a 1-100% otherwise
		#0 is returned when the city npc is killed (until respawn)

		my $qeynosUpkeepPaid = quest::getisupkeeppaid(1);
		#returns 0 if upkeep has not been paid, 1 otherwise.

		#tax rate (merchants) for visitors to the city
		my $qeynosNewbTaxes = quest::getcitynewbietaxrate(1);

		#citizen tax rate
		my $qeynosCitTaxes = quest::getcitycitizentaxrate(1);

		#get cost in copper of upkeep/day
		my $qeynosUpkeepCost = quest::getcityupkeepcost(1);
	}
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
  #6  
Old 10-20-2012, 04:22 PM
image
Demi-God
 
Join Date: Jan 2002
Posts: 1,290
Default

Not to necro a post or anything but since I got a PM about asking for this source I have put it back up at www.eqpvp.com/archive -- the old site isn't available at this time. Also there are a lot of fixes I have applied since then, eventually I will get to packing it all up again, but likely won't be soon.
__________________
www.eq2emu.com
EQ2Emu Developer
Former EQEMu Developer / GuildWars / Zek Seasons Servers
Member of the "I hate devn00b" club.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:11 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3