HELP ValorPoints and Monster Kill Questions

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

HELP ValorPoints and Monster Kill Questions

Postby AnimalCrackerz on Sat Oct 14, 2017 1:01 pm

Is there a way to give 1 Valor Point per monster killed in a similar way that exp is given? Trying to accumulate points for killing mobs for the Valor shops without having to do the quests just in general you earn Valor point per mob killed??.

this is from the Monsterevents.cpp
  1. bool CMonster::OnDie( )
  2. {
  3.     //CMap* map = GServer->MapList.Index[Position->Map];
  4.  
  5.     //LMA begin
  6.     //CF mode 1
  7.     //20070621-211100
  8.     //Deleted the 20091114
  9.     UINT special_exp=0;
  10.     UINT special_lvl=0;
  11.     GServer->GiveExp( this , special_lvl, special_exp );
  12.     //LMA End
  13.  
  14.  
  15.     return true;
  16. }
AnimalCrackerz
Pomic
Pomic
 
Posts: 102
Joined: Tue Apr 20, 2010 1:58 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby L3nn0x on Sat Oct 14, 2017 3:24 pm

You'll have to modify the server to add a function that adds valor points and then call that function when a monster dies. There might already be such a function (to reward finished quests), in which case it's just a matter of finding the function and calling it. I'd grep through the code source to see if it's already there
L3nn0x
osiRose dev
osiRose dev
 
Posts: 111
Joined: Wed Oct 21, 2015 8:22 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby PurpleYouko on Sat Oct 14, 2017 5:36 pm

You could add a command in the main loop when it runs AIP type 5 (monster died)

Or you could write a single AIP script containing nothing but the on death clause then preload it from fileaip.stb and finally hijack the AIP handling itself to directly run this script each time a monster dies. That way the actual code to assign the valor points is already being handled as per the AIP script
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby AnimalCrackerz on Tue Oct 24, 2017 3:52 pm

thisclient->CharInfo->Valor++;

added this into the GiveEXP command. Works great.
AnimalCrackerz
Pomic
Pomic
 
Posts: 102
Joined: Tue Apr 20, 2010 1:58 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby PurpleYouko on Tue Oct 24, 2017 5:01 pm

AnimalCrackerz wrote:thisclient->CharInfo->Valor++;

added this into the GiveEXP command. Works great.

Or
You could just do it the easy way like this :mrgreen:
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby Vetyst on Mon Oct 30, 2017 1:33 pm

You are welcome :D
User avatar
Vetyst
osRose dev
osRose dev
 
Posts: 146
Joined: Sat Jun 18, 2011 10:56 am
Location: The Netherlands

Re: HELP ValorPoints and Monster Kill Questions

Postby AnimalCrackerz on Tue Oct 31, 2017 3:26 am

ha ha forgot credits for Vetyst! for helping simplify for me~ cheers mate
AnimalCrackerz
Pomic
Pomic
 
Posts: 102
Joined: Tue Apr 20, 2010 1:58 pm

Re: HELP ValorPoints and Monster Kill Questions

Postby GameSlim on Sun Jun 07, 2020 6:36 pm

Had my diffrent way of giving Valor to players. I added it so the valor point is given when a mob dies.
Also the point is given right away so you see it updated real time on your screen's ALT+A.

Somewhere around " if(Enemy->IsDead())"
  1.  
  2.     if(Enemy->IsDead())
  3.     {
  4.         CDrop* thisdrop = NULL;
  5.         ADDDWORD   ( pak, hitpower );
  6.         ADDDWORD   ( pak, 16 );
  7.         if(!Enemy->IsSummon( ) && !Enemy->IsPlayer( ))
  8.         {
  9.             //LMA: looping the drops (double drop medal for example).
  10.             int nb_drops = GServer->Config.ItemDropRate;
  11.             if (IsPlayer())
  12.             {
  13.                 CPlayer* plkiller=(CPlayer*) this;
  14.                 nb_drops += plkiller->bonusddrop + Stats->itemdroprate;
  15.                 int addvalor = 10; // Number of valor given per mob kill
  16.                 {
  17.  
  18.                     plkiller->CharInfo->Valor += addvalor;
  19.  
  20.                     BEGINPACKET( pak1, 0x720 ); // Send valor update packet - Terr0risT
  21.                     ADDWORD( pak1, 82 );
  22.                     ADDWORD( pak1, addvalor );
  23.                     ADDWORD( pak1, 0 );
  24.                     plkiller->client->SendPacket( &pak1 );
  25.                 }
  26.  
GameSlim
Little soul
Little soul
 
Posts: 3
Joined: Sun Jan 07, 2018 11:52 pm


Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 10 guests