107 Commits

Author SHA1 Message Date
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
81e7cf5a32
[Quest API] Convert Spell Events to similar formats and exports. (#1618)
* [Quest API] Convert Spell Events to similar formats and exports.
Export spell ID, caster ID, caster level, tics remaining, and buff slot to Perl/Lua spell events.
- Export e.buff_slot, e.caster_id, e.caster_level, e.spell_id, and e.tics_remaining to `event_spell_buff_tic`, `event_spell_effect`, and `event_spell_fade` in Lua.
- Export $buff_slot, $caster_id, $caster_level, $spell_id, $tics_remaining to `EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT`, `EVENT_SPELL_EFFECT_BUFF_TIC_NPC`, `EVENT_SPELL_EFFECT_CLIENT`, `EVENT_SPELL_EFFECT_NPC`, and `EVENT_SPELL_FADE` in Perl.

* Formatting.

* Remove debug variable.
2021-10-20 16:02:12 -04:00
Natedog2012
7823ff5336
[Quest API] Add EVENT_LOOT_ZONE to zone_controller (#1608)
* Add EVENT_LOOT_ZONE to zone_controller

* Fix porting event_loot_zone to lua API

* Remove extra spacing and remove forced message to allow for scripted responses.

* Allow all script parsing to fire before sending a failed lootitem, add corpse_id

* Only search for zone_controller once
2021-10-16 23:19:19 -05:00
Kinglykrab
8eef7bb283
[Quest API] Add EVENT_COMBINE to Perl and Lua. (#1536)
- Exports $container_slot in Perl.
- Exports e.container_slot in Lua.

Allows you to perform events when clicking combine in a tradeskill container.
2021-09-19 15:22:51 -05:00
Kinglykrab
6e76f89ca2
[Quest API] Add EVENT_CONSIDER to Perl and Lua. (#1531)
* [Quest API] Add EVENT_CONSIDER to Perl and Lua.
- Exports $entity_id in Perl.
- Exports e.entity_id in Lua.

Allows you to perform events on consider for server operators.

* Missing comma.

* Formatting.

* Add return capability to EVENT_CONSIDER and EVENT_CONSIDER_CORPSE so operators can break out of consider functions.
2021-09-13 15:30:17 -04:00
Kinglykrab
38a86edc70
[Quest API] Add EVENT_CONSIDER_CORPSE to Perl and Lua. (#1530)
- Exports $corpse_entity_id in Perl.
- Exports e.corpse_entity_id in Lua.

Allows you to perform events on corpse consider for server operators.
2021-09-12 22:39:09 -05:00
Dencelle
7b069dcf20
[Cheat Detection] Anti-Cheat reimplementation (#1434)
* [Cheat Detection] Anti-Cheat reimplementation

* minor patch fixes

* ceiling to server side runspeed

Warp(LT) was picking up a bunch of expected 6.2 but it was reported back as 6.5, this should help reduce the amount of false positives we get

* use ceil instead of std::ceilf for linux

* boat false positive fix

* stopping the double detection

* fixes and cleanup

* auto merge tricked me...

* dummy divide by 0 checks

this should prevent anyone from setting Zone:MQWarpDetectionDistanceFactor to 0 and causing a crash.

* Formatting

* encapsulation to its own class and clean up

* more detections

* typo

* OP_UnderWorld implmentation

* Update client_packet.h

* Syntax changes, formatting, cleanup

* preventing crashes due to invalid packet size

* typos and clearer logic

* seperated the catagory for cheats

* Updated MQGhost for more detail

Co-authored-by: Akkadius <akkadius1@gmail.com>
2021-08-31 01:08:31 -05:00
Dencelle
4f5824b4a1
[Feature] Add lua and perl event for test buff (#1403)
* [Feature] Add lua and perl event for test buff

* added EnableTestBuff
2021-06-16 10:04:34 -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
Michael Cook (mackal)
86ce506956
[Cleanup] Nuke Make/AppendAnyLenString (#1251)
* Add a std::string overload for Database::SetMQDetectionFlag

* Replace calls to MakeAnyLenString in client_packet.cpp

At least the SetMQDetectionFlag ones

* Replace MakeAnyLenString calls in client_process

At least SetMQDectectionFlag ones

* Replace MakeAnyLenString in embparser

fmtlib actually is gross here, oh well.

* Replace MakeAnyLenString in merc

* Replace MakeAnyLenString in inventory

Also if'd out an unfinished implementation of Client::GetItemLinkHash

* Replace AppendAnyLenString in zonelist

* Replace AppendAnyLenString in zonelist

* Replace MakeAnyLenString in clientlist

* Nuke MakeAnyLenString/AppendAnyLenString

* Fix formatting string in zonelist
2021-02-23 18:32:19 -06:00
Kinglykrab
36bfebfe6a Add Inventory methods to Perl.
- Add $client->GetInventory() to Perl.
- Export Lua Inventory methods to Perl.
 - Add quest::createitem(item_id, charges, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six, attuned) to Perl so you can return a ItemInstance for testing purposes.
2021-02-01 21:07:07 -05:00
hg
6266aa86a4 Add perl expedition api 2020-12-30 18:47:31 -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
Uleat
6366a3fa38 Fix for silent saylinks and EVENT_COMMAND calls 2020-01-12 21:11:43 -05:00
Uleat
6c2100a650 Fix for perl EVENT_COMMAND not exporting single arguments 2020-01-12 01:32:51 -05:00
Uleat
852d951b65 Reworked EVENT_COMMAND handling and addressed script commands not present during help use 2020-01-06 15:41:05 -05:00
Akkadius
406b193206 Cleanup Perl logging and streamline formatting, tie errors to main Quests logging category live output, add string utils 2020-01-01 19:04:11 -06:00
Uleat
a325a9978b Added EVENT_COMBINE_VALIDATE to facilitate special case tradeskill combines 2019-11-18 19:39:03 -05:00
Akkadius
859252a270 Move status log calls to use LogInfo 2019-09-01 23:22:40 -05:00
Uleat
87b1d32ce8 Updated PerlembParser::ExportItemVariables to new inventory standard 2019-07-08 21:58:47 -04:00
Noudess
ad97968d5e Fixes for bug wherein illusions other than PC races could be exploited.
Fixed for areas that neglected to take into account alliance and item faction
bonuses.
2019-02-07 14:48:31 -05:00
Uleat
509a2b30a5 Inventory possessions beta testing 2018-08-13 22:32:36 -04:00
Kinglykrab
d64f2e40c5 Implement EVENT_USE_SKILL in Perl/Lua.
- Exports skill_id and skill_level in Perl/Lua whenever a skill is used (bash, kick, taunt, etc.)
2017-06-10 22:20:45 -04:00
Akkadius
7aa1d243b0 [Performance] Reworked how all log calls are made in the source, see changelog.txt for more details 2017-04-01 03:51:46 -05:00
Uleat
8b5dd58e96 Renamed struct EQEmu::ItemBase to EQEmu::ItemData and class ItemInst to EQEmu::ItemInstance 2016-10-16 05:10:54 -04:00
Uleat
579efe83af Renamed EQEmu::Item_Struct to EQEmu::ItemBase to coincide with new inventory naming conventions (re-run shared_memory.exe) 2016-05-27 22:22:19 -04:00
Michael Cook (mackal)
60da544d3a clang-tidy modernize-use-auto 2016-05-25 16:10:28 -04:00
Uleat
3031365e1f Moved struct Item_Struct into namespace EQEmu 2016-05-21 04:54:18 -04:00
Uleat
b327da7092 Activation of the new 'Bots' command system 2016-03-24 18:50:31 -04:00
Akkadius
8425607460 Implemented standardized zone controller scripts (Rule Zone, UseZoneController) Defaulted to true
- When a zone boots, it will spawn an invisible npc by the name of zone_controller
	- Lua and Perl scripts can be represented with this npc as zone_controller.pl/lua
	- This NPC's ID is ruled be define ZONE_CONTROLLER_NPC_ID 10
	- Two EVENT's uniquely are handled with this NPC/controller (They only work with the zone_controller NPC)
		- EVENT_SPAWN_ZONE :: All NPC spawns in the zone trigger the controller and pass the following variables:
			$spawned_entity_id
			$spawned_npc_id
		- EVENT_DEATH_ZONE :: All NPC deaths in the zone trigger the controller event and pass the following variables:
			$killer_id
			$killer_damage
			$killer_spell
			$killer_skill
			$killed_npc_id
2015-12-29 04:08:10 -06:00
Akkadius
53c8d63981 Implement Perl Export Variable settings map (Huge performance boost) (Preliminary) 2015-11-01 15:59:24 -06:00
Michael Cook (mackal)
fe0758c984 Add EVENT_TICK for NPCs
This event fires at the start of the tick processing so we can
script on the actual tick.
2015-08-13 22:30:49 -04:00
Akkadius
ee136881c8 Implemented disjointed zone based time, this can be triggered via quest methods
Added parameter to LUA and Perl method settime(hour, minute, [update_world = true])
	- If update_world is false, the zone will then unsubscribe itself from regular worldserver time synchronizations
Added DB ver 9082 with update to add npc_types texture columns if table does not currently have them
2015-05-25 23:48:11 -05:00
SecretsOTheP
788959a5e2 Haynar's movement fixes.
Changes Speed from float to int. EQ client deals with int step locs better than it does floats according to Haynar's testing.

This also contains mob runspeed changes. I recommend you set runspeeds to start in the DB 1.25 for NPCs below 1.25 which will match player runspeeds almost equally. Existing DBs will need to be updated.

General Cleanup of MobAI functions. Mobs now change their heading on AIMovement timers if their targets' heading has changed since that time. This prevents players from being able to land backstabs inbetween mob swings.

Charmed/feared players now send the appropriate packet, there was a missing CastToClient() in spells that was missing.

Mob runspeed can no longer be snared to 0%, instead, 1% of their base runspeed is the maximum. Roots apply as roots instead of a modifier under this code.

There is going to be bugs with this code. It's better we push through it than revert it. Sanctuary has been running this for a good week and we've worked through the issues.

Misc updates:
Exported some variables to perl, including:

EVENT_ITE_CLICK_CAST:
EVENT_ITEM_CLICK:
spell_id - returns the spell_id of the click effect.
return value - cancels the cast.

EVENT_DROP_ITEM:
quantity - returns the # of items dropped in the packet. If the item has charges, charges are returned here instead.
itemname - name of the item being dropped
itemid - id of the item being droppped
spell_id - spell_id associated with the item's click effect.
slotid - the inventory slot id of the item being dropped.
return value - cancels the item from being dropped.

Added Perl function: CalcEXP. Calculates the experience you would gain for an NPC that cons a specific con value to you.

Fixed a bug where you would receive the group experience bonus and group experience messages for simply being in a group, regardless of the player being in the same zone as you.
2015-05-25 12:35:53 -04:00
SecretsOTheP
4a4a0c5e8b * -Exported additional entity IDs for dropped items to perl upon EVENT_CLICK_OBJECT (clicker_id) and EVENT_PLAYER_PICKUP ($picked_up_entity_id)
-Identified Size / SolidType fields in newer clients and properly exported it to EQEmu for use in UF, RoF, RoF2 via perl accessors. (Should work in LUA, no testing was done though for LUA)
-Added a sanity check for size to objects. Any size over 5000.f seems to crash the newer clients' graphical engines and PEQ has some containers filled in with bogus values.
-Added the ability to return a value on perl function EVENT_PLAYER_PICKUP which sends a fake dropped item ID to the client to generate the appropriate client response so the item can stay on the ground and not be 'picked up'. Should also work in LUA, didn't test LUA.
-Renamed unknown008 and unknown010 to size and solidtype respectively for objects.
2015-05-06 18:50:08 -04:00
JJ
318a664b09 No "sigs". [skip ci] 2015-02-23 19:57:47 -05:00
Akkadius
8229a578ee Implemented event type "EVENT_ENVIRONMENTAL_DAMAGE"
- This event triggers when taking any sort of environmental damage. Example use:
	sub EVENT_ENVIRONMENTAL_DAMAGE{
		quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
		quest::debug("env_damage is " . $env_damage);
		quest::debug("env_damage_type is " . $env_damage_type);
		quest::debug("env_final_damage is " . $env_final_damage);
	}
	Result: (Test falling in Velks): http://i.imgur.com/tPRL7yL.png
2015-01-30 23:01:31 -06: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
Michael Cook (mackal)
f4224b296a We don't need to cast these anymore 2015-01-18 18:29:37 -05:00
Akkadius
467b359d0c Moved all EQEmuLogSys:: enum references used in Log.Out to a namespace 'Logs' for shortening of syntax 2015-01-18 02:20:16 -06:00
Akkadius
c025765283 Renamed DoLog to Out as the aggregate logging function for simplicity of use and shortened syntax of Log.Out 2015-01-18 02:00:15 -06:00
Akkadius
1c048cb1d1 Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog 2015-01-18 01:54:09 -06:00
Akkadius
e9f8d5fa6d Port Status messages from Type to Category 2015-01-18 01:27:52 -06:00
Akkadius
7dbde36b03 Rename reference logger to Log 2015-01-18 00:41:18 -06:00
Akkadius
fdbd76e4ad Replaced Status log calls 2015-01-10 15:54:37 -06:00
Akkadius
be381b4e56 Renamed EQEMuLog class to EQEmuLog 2015-01-08 19:46:28 -06:00
Uleat
34ab3e10f5 Added some nullptr checks for ItemInst* in a few places (tradeskills.cpp - particularly augments - needs a better review) 2014-12-23 10:14:45 -05:00
Trevius
200027bf89 (RoF+) Implemented the 6th Augment Slot for Items.
Player Corpses now saved attuned settings for Items.
Renamed IsInstNoDrop() and SetInstNoDrop() to IsAttuned() and SetAttuned() respectively.
2014-12-15 17:55:23 -06:00
KimLS
04dc593df9 Various bug fixes 2014-08-31 20:27:02 -07:00