16 Commits

Author SHA1 Message Date
hg
3d7c43e92f
[Quest API] Add ResetDecayTimer() to Perl/Lua. (#2520) 2022-11-06 10:48:10 -05:00
hg
7e8a24fcec
[Quest API] Use binding library for perl apis (#2216)
* Add perlbind library

* Convert perl apis to perlbind
2022-07-03 21:33:45 -05:00
Kinglykrab
7c1a139991
[Cleanup] Quest API push methods using invalid types. (#2172)
* [Cleanup] Quest API push methods using invalid types.
- Some push methods were pushing integers as unsigned integers or unsigned integer as integers, this fixes all of that.
- Also cleans up some lines that had multiple function calls on them.

* More cleanup of bools and one expansion name was wrong.
2022-05-15 22:14:16 -04:00
Kinglykrab
b983fac860
[Quest API] Alphabetize Perl method exports. (#1672)
- Keeps things tidier.
Perl script was used to get this in order easily.
```pl
my @perl_file_types = (
	"bot",
	"client",
	"doors",
	"entity",
	"expedition",
	"groups",
	"hateentry",
	"inventory",
	"mob",
	"npc",
	"object",
	"perlpacket",
	"player_corpse",
	"questitem",
	"raids",
	"spell"
);

foreach my $file_type (sort {$a cmp $b} @perl_file_types) {
	my $perl_file = "perl_$file_type.cpp";
	open my $client_file, '<', $perl_file or die "Cannot open file_name $perl_file";
	{
		local $/;
		$content = <$client_file>;
	}
	close $client_file;

	open my $perl_data_file, ">", "perl_$file_type\_data.cpp";

	my @variables = ();

	foreach my $line (split("\n", $content)) {
		if ($line=~/newXSproto\(/i) {
			$line =~ s/\s+/ /g;
			my @line_data = split(/ /, $line);
			push(@variables, join(" ", @line_data));
		}
	}

	foreach my $variable (sort {$a cmp $b} @variables) {
		$variable =~ s/^ //ig;
		print $perl_data_file "\t$variable\n";
	}

	close $perl_data_file;
}```
2021-11-06 17:36:06 -04:00
Kinglykrab
fa8d8eccc2
[Quest API] Add corpse->RemoveItemByID(item_id, quantity) to Perl and Lua. (#1535)
* [Quest API] Add corpse->RemoveItemByID(item_id, quantity) to Perl and Lua.
- Add $corpse->RemoveItemByID(item_id, quantity) to Perl.
- Add corpse:RemoveItemByID(item_id, quantity) to Lua.

* Formatting.
2021-09-13 15:42:04 -04:00
Kinglykrab
56b9b6f2c4
[Quest API] Add corpse->GetLootList() and npc->GetLootList() to Perl and Lua. (#1529)
* [Quest API] Add corpse->GetLootList() and npc->GetLootList() to Perl and Lua.
- Add $corpse->GetLootList() to Perl.
- Add $npc->GetLootList() to Perl.
- Add corpse:GetLootList() to Lua.
- Add npc:GetLootList() to Lua.

Returns an array of item IDs for use with corpse and NPC methods such as HasItem(item_id), CountItem(item_id), and GetFirstSlotByItemID(item_id).

* Categories.

* Modify Lua to use classes.
2021-09-12 22:38:38 -05:00
Kinglykrab
26299354b6
[Quest API] Adds new methods to NPCs and Corpses (#1510)
- Add $npc->HasItem(item_id) to Perl.
- Add $npc->CountItem(item_id) to Perl.
- Add $npc->GetItemIDBySlot(loot_slot) to Perl.
- Add $npc->GetFirstSlotByItemID(item_id) to Perl.
- Add $corpse->HasItem(item_id) to Perl.
- Add $corpse->CountItem(item_id) to Perl.
- Add $corpse->GetItemIDBySlot(loot_slot) to Perl.
- Add $corpse->GetFirstSlotByItemID(item_id) to Perl.
- Add npc:HasItem(item_id) to Lua.
- Add npc:CountItem(item_id) to Lua.
- Add npc:GetItemIDBySlot(loot_slot) to Lua.
- Add npc:GetFirstSlotByItemID(item_id) to Lua.
- Add corpse:HasItem(item_id) to Lua.
- Add corpse:CountItem(item_id) to Lua.
- Add corpse:GetItemIDBySlot(loot_slot) to Lua.
- Add corpse:GetFirstSlotByItemID(item_id) to Lua.

These methods will allow server operators to view the loot a current has in a slot, the first slot found by item ID, count the item by ID, and see if the NPC has the item.

With that functionality you could build a custom loot system and modify loot more dynamically.
2021-08-31 00:42:08 -05:00
TurmoilToad
52a359180c
Add category tags for corpse methods (#1234)
Add category tags for corpse methods.
2021-02-08 23:08:41 -06:00
Kinglykrab
a29de5963f [Quest API] Perl Corpse Validation Macro
Add validation macro to all corpse methods.
2021-02-01 22:34:47 -05:00
Akkadius
88ed2e64bb perl_player_corpse.cpp formatting 2018-07-01 19:36:47 -05:00
Akkadius
2010d1ba83 Update usage docs for perl_player_corpse 2018-07-01 19:36:35 -05:00
Akkadius
0d9b6703a6 Rename debug.h to global_define.h, update cmakelists and such 2015-01-19 04:12:09 -06:00
Akkadius
b43cfa126f Renamed SetPKItem to SetPlayerKillItemID
Renamed AllowMobLoot to AllowPlayerLoot
Renamed DepopCorpse (PC) to DepopPlayerCorpse
Renamed GetPKItem to GetPlayerKillItem
Renamed Corpse class variable 'orgname' to 'corpse_name'
Renamed CompleteRezz to CompleteResurrection
Renamed GetDBID to GetCorpseDBID

Removed CorpseToServerSlot as it is unnecessary
Removed ServerToCorpseSlot as it is unnecessary

Reogrganized corpse.h header
2014-11-25 23:54:59 -06:00
Akkadius
0598f7e87c Fixed an issue that has surfaced with new code behaving how it should, breaking old code. Naked corpses were not despawning on their decay timers because of incorrect return logic on a database function
Removed ClearCorpseItems as it is no longer necessary as corpses deleted items appropriately when they are removed from the corpse
General cleanup of functions and variables in corpse code
2014-11-25 22:47:50 -06:00
Akkadius
111fb84041 Moved zonedatabase functions out of corpse.cpp
Conversion portion mostly complete
Some header readability cleanup
Some function renaming
Struct renaming
Many variable renaming
MySQL error log for all of QueryDatabase
Corpse table renaming
Corpse table field renaming
Most corpse database functions redone
2014-11-22 17:55:48 -06:00
KimLS
07a2cbe9a5 Renamed zone files 2014-08-21 23:46:01 -07:00