Closed fuzzlecutter closed 1 month ago
This enables an npc to cast sacrifice on clients. The purpose is for a quest.
e.self:Emote("looks at you grinning. 'Very well. I will take your essence. You have served us well!', he says, chuckling to himself.");
e.self:Cast(1768, e.other:GetID());
oh? what NPC is this that cast this? Quest name?
Oh, that's not a live quest. Sorry for the confusion. It's a quest I'm adding, custom content. I figured this commit was generic enough that it could be used on takp or other takp forks.
Actually, this doesn't need to be hardcoded. You can just quest it to add item to the NPC loot.
Hmm.. I suppose I could simulate the spell landing with timers, in a sense, via lua. Is the non-rezzable exp death doable via the lua api atm?
it can be made that way. not sure if we currently have lua api that does that. if not, can create one for it. Here's the list of lua corpse: https://github.com/EQMacEmu/Server/blob/main/zone/lua_corpse.cpp
So to go this alternative route, I either would need to
Client::Sacrifice
to accept Mob (and thus Client or NPC) as a parameter, because, as is, it would seg fault / be undefined behavior to call with a nullptr or an NPC. Then expose that method in lua_client.Client::Sacrifice
logic in lua.Honestly would prefer the original approach as it is more generic (removed the hardcoded limitation preventing NPCs from casting sacrifice) and reuses the existing sacrifice, level limits, and exp loss logic.
This was merged upstream in eqemu, https://github.com/EQEmu/Server/commit/cc0171dfe1d77393afd1b7b77029d9e5e8a48990
If you'd prefer, could merge in that commit, and close this PR.
Could you give a description to what this suppose to do? I mean why would a npc sacrifice itself?