EDIT lol i'm stupid :P sorry for this post XD
Printable View
EDIT lol i'm stupid :P sorry for this post XD
Umm ok, but its very sloppy
(in worldserver.cpp)
and here is the weapon attack (in worldclient.cpp)Code:// -------------- UPDATE USER ATTACK AND OR MOVEMENT STOPPERS --------------
for(unsigned j=0; j<ClientList.size(); j++) {
CWorldClient* thisclient = (CWorldClient*)ClientList[j];
if (!thisclient->inGame) continue;
CMonster* thismon = GetMonsterByID(thisclient->targetid);
if (thismon==0) {
CNPC* thisnpc = GetNPCByID(thisclient->targetid);
if (thisnpc==0) continue;
float dx = ( thisclient->pos.x - thisnpc->pos.x );
float dy = ( thisclient->pos.y - thisnpc->pos.y );
if ( (dx*dx)+(dy*dy) <= 2.5*2.5 ) thisclient->nPos = thisclient->pos;
continue;
}
if (thismon->targetid==0) {
thismon->targetid=thisclient->clientid;
thismon->lastMoveTime=clock();
// GO OVER AND ATTACK IT
BEGINPACKET( pak, 0x798 );
ADDWORD( pak, thismon->clientid );
ADDWORD( pak, thisclient->clientid );
ADDWORD( pak, STB_NPC.rows[thismon->montype][3] );
ADDFLOAT ( pak, thisclient->pos.x*100 );
ADDFLOAT ( pak, thisclient->pos.y*100 );
SendToVisible( &pak, thismon );
}
float dx=thismon->pos.x - thisclient->pos.x;
float dy=thismon->pos.y - thisclient->pos.y;
if(thisclient->atktype==0) {
clock_t etime = clock() - thisclient->lastAttackTime;
if (etime > 0.9*CLOCKS_PER_SEC && abs(dx*dx+dy*dy) <= 0) {
unsigned hitpower = unsigned((thisclient->c_level/5) + (thisclient->c_str/2) + (thisclient->c_dex/3.3));
//Log( MSG_DEBUG, "weapon refine:%i",(thisclient->items[7].refine) );
//Log( MSG_DEBUG, "monster defense: %i", thismon->defense );
//Log( MSG_DEBUG, "monster health: %i", thismon->currenthp );
// refined weapon damage needs to be added.
switch(thisclient->items[7].refine){
case 16: // 1
hitpower += int(thisclient->GetAtkPower( )*1.06); // add weapon damage;
break;
case 32: // 2
hitpower += int(thisclient->GetAtkPower( )*1.13); // add weapon damage;
break;
case 48: // 3
hitpower += int(thisclient->GetAtkPower( )*1.2); // add weapon damage;
break;
case 64: // 4
hitpower += int(thisclient->GetAtkPower( )*1.3); // add weapon damage;
break;
case 80: // 5
hitpower += int(thisclient->GetAtkPower( )*1.4); // add weapon damage;
break;
case 96: // 6
hitpower += int(thisclient->GetAtkPower( )*1.5); // add weapon damage;
break;
case 112: // 7
hitpower += int(thisclient->GetAtkPower( )*1.65); // add weapon damage;
break;
case 128: // 8
hitpower += int(thisclient->GetAtkPower( )*1.80); // add weapon damage;
break;
case 144: // 9
hitpower += int(thisclient->GetAtkPower( )*2.0); // add weapon damage;
break;
default: // 0
hitpower += thisclient->GetAtkPower( ); // add weapon damage;
break;
} //end switch
hitpower+= 3*(rand()%(thisclient->c_level))+1;
hitpower -= thismon->defense;
hitpower=(hitpower<0)?0:hitpower;
//Log( MSG_DEBUG, "weapon ap= %i", (thisclient->GetAtkPower( )) );
//Log( MSG_DEBUG, "hitpower= %i", hitpower );
//if (hitpower<5) hitpower = 5;
thismon->currenthp -= hitpower;
if (thismon->currenthp < 0) thismon->currenthp=0;
BEGINPACKET( pak, 0x799 );
ADDWORD( pak, thisclient->clientid );
ADDWORD( pak, thismon->clientid );
ADDDWORD( pak, hitpower );
ADDDWORD( pak, (thismon->currenthp<=0)?16:0 );
SendToVisible( &pak, thismon );
thisclient->lastAttackTime = clock();
}
}else if( thisclient->atktype == 1 ) {
unsigned skillid = thisclient->cskills[thisclient->atkskill].id + thisclient->cskills[thisclient->atkskill].level - 1;
unsigned skillrange = STB_SKILL.rows[skillid][6];
unsigned skillpower = STB_SKILL.rows[skillid][9];
if ( dx*dx+dy*dy <= skillrange*skillrange ) {
thisclient->atktype=-1;
thismon->currenthp -= skillpower;
BEGINPACKET( pak, 0x799 );
ADDWORD( pak, thisclient->clientid );
ADDWORD( pak, thismon->clientid );
ADDDWORD( pak, skillpower );
ADDDWORD( pak, (thismon->currenthp<=0)?16:0 );
SendToVisible( &pak, thismon );
RESETPACKET( pak, 0x7bb );
ADDWORD( pak, thisclient->clientid );
SendToVisible( &pak, thisclient );
}
}
}
Code:// -----------------------------------------------------------------------------------------
// Returns the Weapon Attack Power
// -----------------------------------------------------------------------------------------
unsigned CWorldClient::GetAtkPower( )
{
unsigned atkpower = 0;
for( unsigned j = 0; j < 12; j++ ) {
if( items[j].itemtype == 8 ) {
atkpower += ((CWorldServer*)ParentServer)->STB_ITEM[items[j].itemtype-1].rows[items[j].itemnum][35];
} // end if
} // end for
return atkpower;
}
and that is? the fix or? because killerbee edited his post so i cant see the question -.-
Sry, he asked for my attack script.
hehe np i see :P
Is news about first prof quest fixing ? Or SVN project is dead ?
Lol SVN project is not dead
yea just need more developers >.<
hmm i saw that the comand /ann is taking trash
if u digit /ann aaaaa
it will show 5 a
than if u digit /ann bbbb
it will show 4 b and one a (bbbba)
i dont understand alot of programing, but the fix is maybe clean the buffer or something like this, dont?
hello people i am wit han problem the problem is if i load the logen server its oke the char server is oek to when i start the world server i gat an message after 5 sec in the window SQL:Could not execeute query: Unkown column 'aggrocount' in 'field list' <--- plz could some1 help me
-greets- Ni3tski
hello barnett81, thanks to answered to my pm :) and i wanted to know what going on, i used your atack code and i got that error wheni compile!
------ Build started: Project: 3. World Server, Configuration: Release Win32 ------
Compiling...
worldserver.cpp
.\worldserver.cpp(317) : error C2039: 'GetAtkPower' : is not a member of 'CWorldClient'
c:\svn\world server\worldsockets.h(31) : see declaration of 'CWorldClient'
.\worldserver.cpp(317) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log
Il faut implanter getatkpower dans le worldsocket.cpp
sry, you have to declare the getAtkPower method in worldsockets.h like so:
Code:unsigned GetAtkPower( );
how to insert an field into an table
Click design table and then read FFS! people read and search other threads before posting a question..
*Offtopic; dude why do you talk in orange