Commit Graph

60 Commits

Author SHA1 Message Date
Kinglykrab f65a6d2761 [Quest API] Add AddAISpellEffect(spell_effect_id, base_value, limit_value, max_value) and RemoveAISpellEffect(spell_effect_id) to Lua. (#1981)
- Add npc:AddAISpellEffect(spell_effect_id, base_value, limit_value, max_value) to Lua.
- Add npc:RemoveAISpellEffect(spell_effect_id) to Lua.
2022-02-08 20:46:59 -05:00
KayenEQ 79f250da2d [API] Perl functions added to apply spell effects directly to NPCs without requiring buffs. (#1975)
* script functions working

* Update perl_npc.cpp

* [API] Perl functions added to apply spell effects directly to NPCs without requiring buffs.
2022-02-08 18:32:13 -05:00
Kinglykrab 8ec4afe721 [Commands] Cleanup #wpinfo Command. (#1866)
- Cleanup message and logic.
- Only display grid/waypoints if NPC has a grid.
2021-12-04 21:53:29 -05: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 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 119018cf41 [Quest API] Add GetHealScale() and GetSpellScale() to Perl and Lua. (#1515) 2021-09-03 19:47:33 -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
Alex 26d374d52a [Quest API] Add IsRaidTarget() to Perl and Lua (#1347)
- Add $npc->IsRaidTarget() to Perl.
- Add npc:IsRaidTarget() to Lua.
2021-05-10 01:05:46 -05:00
Alex 1637ea95cb Fix Perl NPC GetAvoidanceRating() Perl Croak. (#1333) 2021-04-27 17:46:59 -04:00
TurmoilToad 041879c4e6 [Quest API] Perl NPC Annotations (#1245)
Added category tag annotations for NPC methods.
2021-02-23 11:59:57 -06:00
Alex 8f89f38f5c Add ScaleNPC() to Perl and Lua. (#1238) 2021-02-08 23:08:07 -06:00
Kinglykrab 963b8fdd53 Formatting NPC validation macro. 2021-02-02 17:06:55 -05:00
Kinglykrab b69213abcc [Quest API] Perl NPC Validation Macro
Add validation macro to all NPC methods.
2021-02-01 22:28:15 -05:00
Alex 1292e1c9c0 Fix $npc->RecalculateSkills() in Perl. 2020-06-28 10:08:21 -04:00
Alex ee55755c85 Add IsTaunting() to Perl/Lua. 2020-05-14 23:55:55 -04:00
Xackery Xtal 0a4429c0c0 Added NPC::RecalculateSkills 2020-02-18 09:21:18 -08:00
Kinglykrab 0b3c489028 Exported MerchantCloseShop() and MerchantOpenShop() to Perl. 2019-09-25 20:07:32 -04:00
Kinglykrab 499c0fdca5 Fixes multi-link Perl croaks, allowing the quest API reader to function properly. 2019-09-10 21:48:15 -04:00
Akkadius 05e7c473df Simplified the use of roamboxes and improved the AI for roambox pathing 2019-08-16 03:25:34 -05:00
KimLS f76fffe622 A bunch of send position changes, rename navigateto 2018-10-15 22:02:16 -07:00
Akkadius d079feeb66 perl_npc.cpp formatting 2018-07-01 20:20:40 -05:00
Akkadius 880285afa6 Add --npc to perl-doc-parser.pl and update usage docs in perl_npc.cpp 2018-07-01 20:20:09 -05:00
Michael Cook (mackal) 3c794cfc07 Add Support to define a valid HP range for NPC casting
These will allow us to define a valid HP range (HP of the caster) that
an NPC will cast a spell. For example NPC casting a defensive spell at
2018-02-01 18:34:07 -05:00
Kinglykrab ceb2b287bb Fixed merchantlist probability.
NPCs were setting a singular chance value and each item was checking based on this value, making the probability field not a random chance per item.
This removes the probability field from NPCs, SetMerchantProbability() and GetMerchantProbability() and makes the probability field truly random chance.

Special thanks to ChaosSlayerZ for noticing the issue here: http://www.eqemulator.org/forums/showthread.php?t=41731
2018-01-27 19:08:15 -05:00
Kinglykrab 6abed18eb9 Added augment support for NPC AddItem() and quest::addloot in Perl/Lua. This will allow you to add items to NPCs with scripts that already have augments in them. 2016-10-20 21:12:47 -04:00
Michael Cook (mackal) 41ca23eb7c Revert "Making $npc->RemoveFromHateList actually work" 2015-05-25 13:20:26 -04:00
hateborne 1bcb5c72a5 Making $npc->RemoveFromHateList actually work
$npc->RemoveFromHateList is a mob function, not an NPC function. Casting
to Mob to let it work.
2015-05-25 10:44:15 -04:00
KayenEQ 69d02b7e72 perl $npc->GetCombatState 2015-03-09 06:40:13 -04:00
KayenEQ d3249397f3 fix to prior commit 2015-02-28 23:39:44 -05:00
KayenEQ 4835b7063c PERL remove proc functions
$npc->RemoveMeleeProc(spell_id)
$npc->RemoveDefensiveProc(spell_id)
$npc->RemoveDefensiveProc(spell_id)
2015-02-28 23:24:19 -05:00
KayenEQ 9d866c1889 perl $npc->ChangeLastName(name)
perl $npc->ClearLastName()
Modifies NPC last names.
2015-02-23 03:52:43 -05:00
KayenEQ 167b6f5ebf perl NPC function RemoveFromHateList(mob) 2015-02-23 00:39:06 -05:00
KayenEQ c8c2209617 Fix for perl defensive/ranged proc function
Minor fix to NPC ranged attack.
2015-02-21 23:04:24 -05:00
KimLS ecd05d821e Merge and fix the loot update branch, ready for merge I think 2015-02-04 23:13:02 -08:00
KimLS 17af9e3808 Merge fixes, hopefully didn't break anything. 2015-01-23 13:36:27 -08:00
KimLS 269d56e1d0 Switched out our kinda juryrigged vector types for glm::vec types since we use that as a 3d math library already but never switched out the types 2015-01-23 00:01:10 -08:00
Akkadius c5447778a6 Merge remote-tracking branch 'remotes/origin/master' into logging_changes
Conflicts:
	world/client.cpp
	world/worlddb.cpp
	zone/aggro.cpp
	zone/bot.cpp
	zone/client.cpp
	zone/client_packet.cpp
	zone/client_process.cpp
	zone/doors.cpp
	zone/entity.cpp
	zone/inventory.cpp
	zone/mob_ai.cpp
	zone/perl_client.cpp
	zone/spells.cpp
	zone/waypoints.cpp
	zone/zone.cpp
	zone/zonedb.cpp
	zone/zoning.cpp
2015-01-21 17:29:30 -06:00
Akkadius 0d9b6703a6 Rename debug.h to global_define.h, update cmakelists and such 2015-01-19 04:12:09 -06:00
Arthur Ice f409d39f1a merge upstream 2014-12-21 13:57:20 -08:00
KayenEQ d69552d4df Perl: NPC AddRangedProc(spellid, chance)
Perl: NPC AddDefensiveProc(spellid, chance)
2014-12-17 05:57:16 -05:00
KayenEQ fc306bbc1d Fix for special attack NPC_CHASE_DISTANCE to now work correctly
Perl export: NPC GetAttackDelay
Perl export: NPC GetAvoidanceRating
Perl export: NPC AddMeleeProc
Special Attacks will no longer be able to hit immune to melee / bane only flagged NPCs.
2014-12-16 18:53:15 -05:00
Arthur Ice e6d23228e5 GetSpawnPointX(), GetSpawnPointY(), GetSpawnPointZ(), and GetSpawnPointH(), converted to GetSpawnPoint() 2014-11-30 15:58:44 -08:00
Arthur Ice 69dbdb2485 GetSpawnPointX(). GetSpawnPointY(), GetSpawnPointZ(), and GetSpawnPointH() replaced with GetSpawnPoint() 2014-11-30 15:29:13 -08:00
Arthur Ice f9036ddc6a GetGuardPointX(), GetGuardPointY(), GetGuardPointZ(), and GetGuardPointH() replaced with GetGuardPoint() 2014-11-30 15:05:50 -08:00
KimLS 7fed01ddea initial rewrite of loot code 2014-09-27 19:57:45 -07:00
KimLS 9f64092606 Merge of kayen's PR as well as some fixes i saw 2014-09-27 14:44:48 -07:00
KayenEQ 31b46efcac Clean up of perl based NPC spell scaling functions.
Added Perl - $npc->GetSpellFocusDMG(), $npc->GetSpellFocusHeal()
2014-09-26 06:56:42 -04:00
Kinglykrab 8b19c76e89 Adds new column to 'merchantlist' table.
Adds 'probability' after 'classes_required', valid values are 0 to 100.
2014-08-21 04:05:45 -04:00
KayenEQ f9b46b46b1 Revision of slow mitigation code.
Fix for the slow mitigation spam messages
Converted value from FLOAT to INT
Use SQL to update your npc_types table
2014-04-12 00:18:19 -04:00
cavedude00 1d6bd3cc5e Better flee runspeed calculation.
Added two new NPC special_abilities, ALWAYS_FLEE and FLEE_PERCENT.
Fixed an issue where a NPC could get stuck on a single coord in a rectangular roambox.
Added mindelay to spawngroup to allow for greater control of the roambox delay. SQL is required.
2014-02-26 18:06:16 -08:00