127 Commits

Author SHA1 Message Date
Kinglykrab
856aa51cb8
[Bots] Add support for Bot scripting. (#2515)
* [Bots] Add support for Bot scripting.

# Perl
- Add support for `zone/bot.pl` and `zone/bot_v#.pl`.
- Add support for `global/global_bot.pl`.
- Add `$bot->SignalBot(signal_id)` to Perl.
- Add `$bot->OwnerMessage(message)` to Perl.
- Add `$entity_list->SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotID(bot_id, signal_id)` to Perl.
- Add `$entity_list->SignalBotByBotName(bot_name, signal_id)` to Perl.
- Add `EVENT_SPELL_EFFECT_BOT` to Perl.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Perl.

# Lua
- Add support for `zone/bot.lua` and `zone/bot_v#.lua`.
- Add support for `global/global_bot.lua`.
- Add `bot:SignalBot(signal_id)` to Lua.
- Add `bot:OwnerMessage(message)` to Lua.
- Add `entity_list:SignalAllBotsByOwnerCharacterID(character_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotID(bot_id, signal_id)` to Lua.
- Add `entity_list:SignalBotByBotName(bot_name, signal_id)` to Lua.
- Add `EVENT_SPELL_EFFECT_BOT` to Lua.
- Add `EVENT_SPELL_EFFECT_BUFF_TIC_BOT` to Lua.

# Supported Bot Events
1. `EVENT_CAST`
2. `EVENT_CAST_BEGIN`
3. `EVENT_CAST_ON`
4. `EVENT_COMBAT`
5. `EVENT_DEATH`
6. `EVENT_DEATH_COMPLETE`
7. `EVENT_SAY`
8. `EVENT_SIGNAL`
9. `EVENT_SLAY`
10. `EVENT_SLAY_NPC`
11. `EVENT_SPAWN`
12. `EVENT_TARGET_CHANGE`
13. `EVENT_TIMER`
14. `EVENT_USE_SKILL`

# Common
- Convert NPC pointers in common events to Mob pointers so bots are supported.
- Convert signal IDs to `int` where it wasn't already, allowing negative signals to be sent properly.

* Add EVENT_POPUP_RESPONSE.

* Cleanup and fix EVENT_COMBAT/EVENT_SLAY/EVENT_NPC_SLAY.

* Fix DoNPCEmote calls.

* Update attack.cpp

* Update event_codes.h

* Update bot_command.cpp
2022-11-16 21:02:16 -06:00
Kinglykrab
8c994fef97
[Quest API] Add Mob Hate Methods to Perl/Lua. (#2548)
* [Quest API] Add Mob Hate Methods to Perl/Lua.

# Perl
- Add `$mob->DamageHateList(damage)` to Perl.
- Add `$mob->DamageHateList(damage, distance)` to Perl.
- Add `$mob->DamageHateListPercentage(damage)` to Perl.
- Add `$mob->DamageHateListPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListBots(damage)` to Perl.
- Add `$mob->DamageHateListBots(damage, distance)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListBotsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListClients(damage)` to Perl.
- Add `$mob->DamageHateListClients(damage, distance)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListClientsPercentage(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCs(damage)` to Perl.
- Add `$mob->DamageHateListNPCs(damage, distance)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage)` to Perl.
- Add `$mob->DamageHateListNPCsPercentage(damage, distance)` to Perl.
- Add `$mob->GetHateListBots()` to Perl.
- Add `$mob->GetHateListBots(distance)` to Perl.
- Add `$mob->GetHateListClients()` to Perl.
- Add `$mob->GetHateListClients(distance)` to Perl.
- Add `$mob->GetHateListNPCs()` to Perl.
- Add `$mob->GetHateListNPCs(distance)` to Perl.

# Lua
- Add `mob:DamageHateList(damage)` to Lua.
- Add `mob:DamageHateList(damage, distance)` to Lua.
- Add `mob:DamageHateListPercentage(damage)` to Lua.
- Add `mob:DamageHateListPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListBots(damage)` to Lua.
- Add `mob:DamageHateListBots(damage, distance)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage)` to Lua.
- Add `mob:DamageHateListBotsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListClients(damage)` to Lua.
- Add `mob:DamageHateListClients(damage, distance)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage)` to Lua.
- Add `mob:DamageHateListClientsPercentage(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCs(damage)` to Lua.
- Add `mob:DamageHateListNPCs(damage, distance)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage)` to Lua.
- Add `mob:DamageHateListNPCsPercentage(damage, distance)` to Lua.
- Add `mob:GetHateListBots()` to Lua.
- Add `mob:GetHateListBots(distance)` to Lua.
- Add `mob:GetHateListClients()` to Lua.
- Add `mob:GetHateListClients(distance)` to Lua.
- Add `mob:GetHateListNPCs()` to Lua.
- Add `mob:GetHateListNPCs(distance)` to Lua.

# Notes
- Offers an extreme amount of short hands when grabbing hate list entities by a specific type or damaging a specific type of entity on an NPC's hatelist.
- Should save operators having to use `GetHateList()` then loop it to get the entries they want to do something.

* Cleanup.
2022-11-16 07:16:47 -06:00
Kinglykrab
8f1b87c5e4
[Quest API] Add Owner methods to Perl/Lua. (#2542)
* [Quest API] Add Owner methods to Perl/Lua.

# Perl
- Add `$mob->GetOwner()` to Perl.

# Lua
- Add `mob:GetOwnerID()` to Lua.

# Notes
- `GetOwner()` exists in Lua, but not Perl.
- `GetOwnerID()` exists in Perl, but not Lua.

* Update lua_mob.cpp
2022-11-14 18:03:26 -05:00
Kinglykrab
e72ec4ae56
[Quest API] Add RandomizeFeature() overloads to Perl/Lua. (#2532)
# Perl
- Add `$mob->RandomizeFeatures()` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion)` to Perl.
- Add `$mob->RandomizeFeatures(send_illusion, set_variables)` to Perl.

# Lua
- Add `mob:RandomizeFeatures()` to Lua.
- Add `mob:RandomizeFeatures(send_illusion)` to Lua.
- Add `mob:RandomizeFeatures(send_illusion, set_variables)` to Lua.

# Notes
- Previous overload required `send_illusion` and `set_variables` despite both default values being `true`, this will allow you to just send nothing if you want both to be `true`.
- Change `RandomizeFeatures()` type to `bool` from `void` to match source method, returns `false` when used on a race that has no features to randomize.
- This allows operators to do something different if the NPC can't use this method.
2022-11-14 16:59:17 -05:00
Kinglykrab
31e5622dad
[Quest API] Add CloneAppearance() to Perl/Lua. (#2531)
* [Quest API] Add CloneAppearance() to Perl/Lua.

# Perl
- Add `$client->CloneAppearance(other)` to Perl.
- Add `$client->CloneAppearance(other, clone_name)` to Perl.

# Lua
- Add `client:CloneAppearance(other)` to Lua.
- Add `client:CloneAppearance(other, clone_name)` to Lua.

# Notes
- Allows operators to easily clone appearance between mobs in a script without relying on a plugin or module.

* Update mob_appearance.cpp

* Update mob.cpp
2022-11-14 14:05:05 -05:00
Kinglykrab
a3928ec504
[Quest API] Add GetUltimateOwner() to Perl/Lua. (#2516)
# Perl
- Add `$mob->GetUltimateOwner()` to Perl.

# Lua
- Add `mob:GetUltimateOwner()` to Lua.

# Notes
- Allows operators to get ultimate owner of something like a pet's pet or a pet's swarm pet.
2022-11-05 08:35:14 -04:00
Aeadoin
1d8dc4c8a8
[Feature] Change Mana Costs to use Signed Int (#2384) 2022-08-21 15:38:21 -04:00
Kinglykrab
aa2b7f8947
[Quest API] Add GetSkillDmgAmt() to Perl. (#2365)
- Add $mob->GetSkillDmgAmt(skill_id) to Perl.
- This already exists in Lua, but not Perl.
2022-08-10 13:39:51 -04:00
hg
793d4bc3a4
[Quest API] Use Floating Point for CameraEffect Intensity (#2337)
This was implemented in a very odd way. The intensity is just a float.

This is a breaking api change but low-impact (intensity will be
different).

To convert old values to new values with same intensity:

  0: 0.03125
  1: 0.05625
  2: 0.1
  3: 0.175
  4: 0.3
  5: 0.5
  6: 0.9
  7: 1.6
  8: 2.8
  9: 4.8
 10: 8.0
2022-07-30 19:18:20 -05:00
hg
44dc9967a3 Add perl SpellFinished overload 2022-07-04 11:19:44 -04: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
Quintinon
a00f086bb8
[Combat] Fix shield calculation (#2234)
* Fix max mitigation calculation

* Fix shield ability not receiving correct arguments from perl script.

* Correct shielder having wrong mitigation set.
2022-06-01 17:17:14 -04:00
Kinglykrab
11369247b1
[INT64] Further int64 cleanup in Perl SetHP() and GetSpellHPBonuses() in Perl/Lua. (#2222) 2022-05-29 16:36:32 -05:00
Kinglykrab
8f3ac74196
[INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua. (#2218)
* [INT64] Fix int64 for OOC Regen and GetHP(), GetMaxHP(), GetItemHPBonuses() in Perl/Lua.
- These all had int64 values and were overflowing, returning garbage data.

* Update npc.cpp
2022-05-29 14:33:30 -04: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
Chris Miles
209b0eb273
[int64] Hate Fixes (#2163)
* Hate fixes

* Update perl_hateentry.cpp

* Update perl_hateentry.cpp
2022-05-09 20:49:43 -05:00
Chris Miles
f201d4c999
[int64] Support for HP / Mana / End / Damage / Hate (#2091)
* Initial int64 work

* Hate 64 bit

* Update special_attacks.cpp

* Aggro / Damage / Hate int64

* NPC edit adjustments

* Fix bot compile

* More int64 adjustments

* More int64 references

* npcedit references

* aggrozone

* More int64 changes

* More int64 changes for damage

* Many more damage int64 references

* More spell damage int64 conversions

* HealDamage

* Damage fully working

* Remove debug

* Add migration

* More int64 adjustments

* Much wow, many int64

* More int64

* PR adjustments
2022-05-07 22:32:02 -05:00
KayenEQ
615f4a5304
[API] Apply spells with custom buff durations and adjust existing spell buff durations. (#1997)
* working

* Update spell_effects.cpp

* updates

* disable_buff_overwrite

* revert

* update

* working

* update

* updates

* Update spells.cpp

* getbuffstat done

* Update perl_mob.cpp

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* [API] Apply spells with custom buff durations and adjust existing spell buff durations.

* https://github.com/EQEmu/Server/pull/1997

Lua added, thanks kinglykrab
2022-02-15 08:58:10 -05:00
KayenEQ
b938e6223c
[Spells] Invisibility updates and rework (#1991)
* updates pre merge

* update

* Update spell_effects.cpp

* Update mob.h

* test

* test

* updates

* updates

* save

* update

* working solid

* animal and undead start

* progress

* updates

* rename

* set invis appearance on bonus

* remove fade buff state check

* update IsViisble check

* optimizing

* don't break bots

* debug remover

* Update ruletypes.h

* perl adds

* Update client_packet.cpp

* update

* done

* remove debugs

* Update client_packet.cpp

* update

* [Spells] Invisibility updates and rework

lua support

* [Spells] Invisibility updates and rework

lua
2022-02-15 00:18:02 -05:00
Kinglykrab
c0f57bed1f
[Bug Fix] Cleanup Perl croaks for Spire parser. (#1908)
- Client::SendToInstance()
- Mob::DeleteBucket()
- Mob::GetBucket()
- Mob::GetBucketExpires()
- Mob::GetBucketRemaining()
- Mob::SetBucket()
2021-12-30 19:47:52 -06:00
KayenEQ
8de410ebb7
[Features] Appearance Effects will now be sent to clients upon zone in. GM commands. (#1874)
* start

* working

* Update perl_mob.cpp

* updates

* Update perl_mob.cpp

* illusion behavior

* rework start

* fix later

* Update mob.cpp

* rework

* updates

* Update mob.cpp

* update

* gm command updates

* updates

* Update CMakeLists.txt

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

remove debugs

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

perl fix

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

space fix

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

minor fix

* Update CMakeLists.txt

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.

cleaned up some inconsistency

* [Features] Appearance Effects will now be sent to clients upon zone in. GM commands.
2021-12-10 13:46:23 -05:00
Natedog2012
0f4f5d7046
RemoveAllAppearanceEffects sends all relevant data so NPC appearance doesn't get altered. (#1864) 2021-12-07 15:15:28 -05:00
KayenEQ
6a28828e08
[API] mob->AppearanceEffects improved functionality. (#1821)
* appearanceffectscript

* update

* debugged

* [API] SendAppearanceEffect update

* [API] SendAppearanceEffect update

* [API] SendAppearanceEffect Upates

perl method RemoveAppearanceEffect to remove the apperanceeffect

* [API} AppearanceEffects update

* [API] SendAppearanceEffects update
2021-11-27 12:10:08 -05:00
KayenEQ
6ff7f7aa53
[API] mob->SpellEffect small perl fix (#1820)
* Update perl_mob.cpp

* Update perl_mob.cpp
2021-11-24 12:48:23 -05:00
KayenEQ
8f3cce6585
send graphic to target correctly (#1785) 2021-11-23 12:55:58 -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
17aaab1f9d
[Quest API] Add Spell methods to Perl. (#1631)
* [Quest API] Add Spell methods to Perl.
- Add quest::getspell(spell_id) to Perl.
- Add eq.get_spell(spell_id) to Lua.
These methods return a spell object.

Exports $spell object references to spell events.

* Formatting.

* Remove comment.

* Update spdat.cpp

* Amplication typo.

* Fix conflicts.

* Remove repository changes.

* Fix typing.

* Update spell_effects.cpp
2021-11-03 17:47:15 -04:00
Kinglykrab
3dcddcba04
[Quest API] Add GetHateRandomBot(), GetHateRandomClient(), and GetHateRandomNPC() to Perl/Lua. (#1613)
- Add $mob->GetHateRandomBot() to Perl.
- Add $mob->GetHateRandomClient() to Perl.
- Add $mob->GetHateRandomNPC() to Perl.
- Add mob:GetHateRandomBot() to Lua.
- Add mob:GetHateRandomClient() to Lua.
- Add mob:GetHateRandomNPC() to Lua.
2021-10-17 23:41:10 -04:00
hg
fb98349bbd
[Quest API] Add mob SetPet and RemovePet quest apis (#1569)
Will be required for tutoriala script and other similar events
2021-10-01 22:11:16 -05:00
Chris Miles
3883adcefc
[Dialogue Window / Saylinks] Missing Changes (#1574)
* Implement auto saylink injection

* Cover Lua say since it takes a different code path

* [Dialogue] Dialogue Window Middleware (#1526)

* Dialogue window quest dialogue work

* Add rest of DialogueWindow hooks

* Remove spacing
2021-10-01 22:09:21 -05:00
Chris Miles
6b93130c13
[Saylinks] Implement Auto Saylink Injection (#1525)
* Implement auto saylink injection

* Cover Lua say since it takes a different code path
2021-09-12 22:08:30 -05:00
KayenEQ
d40d21121a
[Feature] Implemented /shield ability and related affects (#1494)
* shield ability initial work

* updates

* update

* updates

* Update client_process.cpp

* major updates

optimized
pet support
perl support

* updates

* minor update

* fix merge error

* requested changes

* variable fix

* optimization

* minor update

* Revert "optimization"

This reverts commit 27e11e758b23933ba8b6878d12d3eeb1e780aeda.

* fix

reset variables on shield_target if shielder dies or zones during shielding.

* edge case fix

Catch and fix situations where shield target doesn't have shielder variable cleared. Can occur if shielder . uses ability when target is not in combat then zones.

* combined packet and mob function

Shield now uses a common pathway through ShieldAbility, added parameters to perl function

* Addressing formatting for Kayen

* Fix function typo

Co-authored-by: Akkadius <akkadius1@gmail.com>
2021-08-15 22:59:10 -05:00
Alex
249cbb7bc7
[Quest API] Add CanRaceEquipItem(item_id) to Perl/Lua. (#1411)
* [Quest API] Add CanRaceEquipItem(item_id) to Perl/Lua.
- Add $mob->CanRaceEquipItem(item_id) to Perl.
- Add mob:CanClassEquipItem(item_id) to Lua.
- Add mob:CanRaceEquipItem(item_id) to Lua.

* Use constants.

Co-authored-by: Chris Miles <akkadius1@gmail.com>
2021-06-17 18:42:44 -04:00
Alex
3f8b67e500
[Quest API] Add RemoveAllNimbusEffects() to Perl/Lua. (#1413)
* [Quest API] Add RemoveAllNimbusEffects() to Perl/Lua.
- Add $client->RemoveAllNimbusEffects() to Perl.
- Add client:RemoveAllNimbusEffects() to Lua.

* Optimize.
2021-06-17 11:40:01 -05:00
Alex
797eaf308d
[Quest API] Add AddNimbusEffect(effect_id) to Perl. (#1412)
- Add $client->AddNimbusEffect(effect_id) to Perl.
2021-06-16 10:06:30 -05:00
Alex
d9d6a64941
[Bots] Add Bot scripting capabilities to the source. (#1378)
- This will allow server operators to interact with bots within a script in Perl or Lua.
2021-06-11 13:46:30 -05:00
Alex
0f23bd24cc
[Quest API] Convert Client GetLastName() method export to Mob export. (#1331) 2021-04-22 22:41:19 -05:00
Alex
af517be184
Merge branch 'master' into hate_list_quest_api 2021-02-25 22:58:41 -05:00
Kinglykrab
1af1b7bbdc [Quest API] Add GetHateClosest() and GetHateListByDistance(distance) to Perl/Lua. 2021-02-25 22:53:33 -05:00
Alex
66d24ff419
[Quest API] Add IsHorse() to Perl and Lua. (#1264) 2021-02-23 20:50:06 -06:00
TurmoilToad
f8edde9587
[Quest API] Perl Mob Annotations (#1258)
Added category tag annotations for mob methods.
2021-02-23 11:54:01 -06:00
Alex
f2b67ae969
[Quest API] Add Mob-based data bucket methods to Perl/Lua. (#1237)
* Add Mob-based data bucket methods to Perl/Lua.

* Update mob.cpp

* Update perl_mob.cpp
2021-02-08 23:06:33 -06:00
Kinglykrab
4338d657fc [Quest API] Perl Mob Validation Macro
Add validation macro to all mob methods.
2021-02-01 22:24:36 -05:00
Kinglykrab
7e1e1651e4 Add GetClassBitmask(), GetClassName(), GetRaceBitmask(), and GetRaceName() to Perl/Lua. 2021-01-18 18:47:32 -05:00
Alex
eb039d176c Add GetDisplayAC() to Perl/Lua. 2020-06-29 15:49:24 -04:00
Chris Miles
a64c0dfd92
Merge pull request #1063 from EQEmu/maketemppet
Remove duplicate MakeTempPet() definition.
2020-05-19 02:37:46 -05:00
KimLS
2fbd5aaccc Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore) 2020-05-17 18:36:06 -07:00
Alex
968efe8831 Remove duplicate MakeTempPet definition. 2020-05-16 14:30:35 -04:00
Uleat
6c35611cd0 Exported Entity::IsBot() (as Mob) to the perl api 2019-12-24 16:24:25 -05:00
Kinglykrab
499c0fdca5 Fixes multi-link Perl croaks, allowing the quest API reader to function properly. 2019-09-10 21:48:15 -04:00