Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-10-2006, 10:08 AM
aza77
Hill Giant
 
Join Date: Dec 2004
Posts: 126
Default

diff -u -r EQEmu-0.6.6-767/zone/perlparser.cpp EQEmu-0.6.6-728/zone/perlparser.cpp
--- EQEmu-0.6.6-767/zone/perlparser.cpp 2006-03-19 05:09:26.000000000 +0100
+++ EQEmu-0.6.6-728/zone/perlparser.cpp 2006-04-10 21:12:27.000000000 +0200
@@ -355,6 +355,21 @@
XSRETURN_EMPTY;
}

+XS(XS__incstat); //old setstat command aza
+XS(XS__incstat)
+{
+ dXSARGS;
+ if (items != 2)
+ Perl_croak(aTHX_ "Usage: incstat(stat, value)");
+
+ int stat = (int)SvIV(ST(0));
+ int value = (int)SvIV(ST(1));
+
+ quest_manager.incstat(stat, value);
+
+ XSRETURN_EMPTY;
+}
+
XS(XS__castspell);
XS(XS__castspell)
{
@@ -1479,6 +1494,7 @@
newXS(strcpy(buf, "spawn2"), XS__spawn2, file);
newXS(strcpy(buf, "unique_spawn"), XS__unique_spawn, file);
newXS(strcpy(buf, "setstat"), XS__setstat, file);
+ newXS(strcpy(buf, "incstat"), XS__incstat, file);
newXS(strcpy(buf, "castspell"), XS__castspell, file);
newXS(strcpy(buf, "selfcast"), XS__selfcast, file);
newXS(strcpy(buf, "addloot"), XS__addloot, file);

diff -u -r EQEmu-0.6.6-767/zone/questmgr.cpp EQEmu-0.6.6-728/zone/questmgr.cpp
--- EQEmu-0.6.6-767/zone/questmgr.cpp 2006-03-19 05:09:26.000000000 +0100
+++ EQEmu-0.6.6-728/zone/questmgr.cpp 2006-04-10 19:46:05.000000000 +0200
@@ -268,6 +268,11 @@
initiator->SetStats(stat, value);
}

+void QuestManager::incstat(int stat, int value) { //old setstat command aza
+ if (initiator)
+ initiator->IncStats(stat, value);
+}
+
void QuestManager::castspell(int spell_id, int target_id) {
if (npc) {
Mob *tgt = entity_list.GetMob(target_id);

diff -u -r EQEmu-0.6.6-767/zone/questmgr.h EQEmu-0.6.6-728/zone/questmgr.h
--- EQEmu-0.6.6-767/zone/questmgr.h 2006-03-19 05:09:26.000000000 +0100
+++ EQEmu-0.6.6-728/zone/questmgr.h 2006-04-10 19:19:37.000000000 +0200
@@ -50,6 +50,7 @@
int16 spawn2(int npc_type, int grid, int unused, float x, float y, float z, float heading);
int16 unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading = 0);
void setstat(int stat, int value);
+ void incstat(int stat, int value); //old setstat command
void castspell(int spell_id, int target_id);
void selfcast(int spell_id);
void addloot(int item_id, int charges = 0);

diff -u -r EQEmu-0.6.6-767/zone/command.cpp EQEmu-0.6.6-728/zone/command.cpp
--- EQEmu-0.6.6-767/zone/command.cpp 2006-03-21 04:26:31.000000000 +0100
+++ EQEmu-0.6.6-728/zone/command.cpp 2006-04-10 23:28:47.000000000 +0200
@@ -152,7 +152,8 @@
command_add("bind","Sets your targets bind spot to their current location",200,command_bind) ||
command_add("sendop","[opcode] - LE's Private test command, leave it alone",200,command_sendop) ||
command_add("optest","solar's private test command",255,command_optest) ||
- command_add("setstat","Increases or Decreases a client's stats permanently.",200,command_setstat) ||
+ command_add("setstat","Sets the stats to a specific value.",255,command_setstat) ||
+ command_add("incstat","Increases or Decreases a client's stats permanently.",200,command_incstat) ||
command_add("help","[search term] - List available commands and their description, specify partial command as argument to search",0,command_help) ||
command_add("version","- Display current version of EQEmu server",0,command_version) ||
command_add("eitem","- Changes item stats",200,command_eitem) ||
@@ -671,6 +672,17 @@
}
else{
c->Message(0,"This command is used to permanently increase or decrease a players stats.");
+ c->Message(0,"Usage: #setstat {type} {value the stat should be}");
+ c->Message(0,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6");
+ }
+}
+
+void command_incstat(Client* c, const Seperator* sep){
+ if(sep->arg[1][0] && sep->arg[2][0] && c->GetTarget()!=0 && c->GetTarget()->IsClient()){
+ c->GetTarget()->CastToClient()->IncStats(atoi(sep->arg[1]),atoi(sep->arg[2]));
+ }
+ else{
+ c->Message(0,"This command is used to permanently increase or decrease a players stats.");
c->Message(0,"Usage: #setstat {type} {value by which to increase or decrease}");
c->Message(0,"Note: The value is in increments of 2, so a value of 3 will actually increase the stat by 6");
c->Message(0,"Types: Str: 0, Sta: 1, Agi: 2, Dex: 3, Int: 4, Wis: 5, Cha: 6");

diff -u -r EQEmu-0.6.6-767/zone/command.h EQEmu-0.6.6-728/zone/command.h
--- EQEmu-0.6.6-767/zone/command.h 2006-01-13 07:57:03.000000000 +0100
+++ EQEmu-0.6.6-728/zone/command.h 2006-04-10 23:31:06.000000000 +0200
@@ -69,6 +69,7 @@
void command_sendop(Client *c, const Seperator *sep);
void command_optest(Client *c, const Seperator *sep);
void command_setstat(Client *c, const Seperator *sep);
+void command_incstat(Client *c, const Seperator *sep);
void command_help(Client *c, const Seperator *sep);
void command_version(Client *c, const Seperator *sep);
void command_eitem(Client *c, const Seperator *sep);
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:23 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3