setting coin on death
I'm trying to set coin on a mob as you would in the database normally but i want excessive amounts of copper and silver to drop. Here's my code, seems to be doing nothing.
I also want to make different amounts drop, is there an easy way to do that? I was thinking I would make a different amount drop for each minute of the hour on ingame time or something ^^. sub EVENT_DEATH { quest::SetCash(115, 30, 1, 0); } |
There is certainly an explosion of "Opening Posts" going on here lately. :) Hungry little Emu'ers...
Where are you getting quest::SetCash(); as a valid command? I do not see that in the lexicon, though it is a little outdated. |
I found it on this page http://www.eqemulator.net/wiki/wikka...a=QuestObjects
figured i'd give it a try although i wasn't sure if it actually was a command. I know i can use "quest::givecash ();" but that wasn't really what i wanted. |
Holy crap! How did I never find that Wiki in a year of using the hell out of it? Thanks, man. I never even knew about all those questobjects (most I have done with quests really is fix things that were broken)
Wow, what a busy weekend you just created for me. |
lol. Yeah i've just been doing the most basic things with quests so far, wasn't till now that i needed more. So should "quest::SetCash(115, 30, 1, 0);" work? b/c it doesn't...
|
I'll see if I can look through the source today to see what's up. I am not very familiar with the whole perl/script part of the code though.
|
Easy way to do this is mincash and maxcash in the database. The values are in copper, so if you wanted all of that npc_type to drop between 100 and 300 plat, you'd use mincash value as 100 and maxcash as 300.
There's no need for perl, it's easier to do it in SQL. Also, John, bleh added those recently, they are cut out from KMRA. Really neat commands. |
Quote:
|
Quote:
You just want copper to drop, right? Yeah you're gonna need to use a quest I think heh. There was a way without quests, I swear there was. Let me take a look at the quest commands. EDIT: $corpse->SetCash(in_copper, in_silver, in_gold, in_platinum) So it would be... Code:
sub EVENT_DEATH Should work in theory. |
Woot, exactly what i want but no worky unfortunately.
|
Anyone know how I could get this working? Still would really like to be able to do this.
Code:
sub EVENT_DEATH |
well, dunno about the guide linked to, but IN THE GAME, it goes BACKWARDS of what you have typed.. it goes "Plat, Gold, Silver, Copper"..
The way I've been doing it (with a hotbutton INGAME)..have the character targeted ... #npcloot money 34664 0 0 0 (and hit enter) (that's 34664 plat, 0 gold, 0 silver and 0 copper) if you want this to be a permanent change, you can do #npcspawn update (and hit enter) and the next time it spawns, it will spawn with those changes (you can also do, right now, #depopzone and then #repop to get it to respawn) Sorry if that's not what you are looking for, ... I found these commands ingame using #help |
I think this might be a misunderstanding of the original source.
To start, the headers for the commands are located in the utils/perlxs directory and the actual source for the commands is in the zone directory. If you search through all of the header files (*.h), SetCash() is defined in PlayerCorpse.h: Code:
SetCash(int16 in_copper, int16 in_silver, int16 in_gold, int16 in_platinum); Code:
sub EVENT_SAY { Quote:
Code:
AddCash(int16 in_copper, int16 in_silver, int16 in_gold, int16 in_platinum); Quote:
Code:
sub EVENT_DEATH { Quote:
In conclusion, if you change SetCash to AddCash, it will work IF you add it while the NPC is still alive. EVENT_SPAWN is probably the best place for it, so this is the code you should use: Code:
sub EVENT_SPAWN { |
Damn, you are good! Thanks a bunch man. Damn excited to have this finally solved. And great info on how you solved it too, didn't know all that was in the code. :)
|
All times are GMT -4. The time now is 06:40 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.