EDIT lol i'm stupid :P sorry for this post XD
EDIT lol i'm stupid :P sorry for this post XD
Last edited by Killerbee(NL); 14-11-06 at 07:24 PM.
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; }
Last edited by barnett81; 14-11-06 at 07:29 PM.
and that is? the fix or? because killerbee edited his post so i cant see the question -.-
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
i dont know i always talk in orange. bud anyways thank you allot
EDIT: i changed my respawn and i disigned it i putted an collumn in it and called it aggrocount and when i sart the server now the World server crashes :S plz help me and tel me what top do (i disigned the column like this aggrocount int 11 0 checked)
-greets- Ni3tski
Last edited by Ni3tski; 17-11-06 at 04:20 PM.
people update the svn with the database release its really good..
Quote:
Originally Posted by r4ptor View Post
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?
In gmcmds.cpp, find:
Code:
ADDSTRING( pak, (&P->Buffer[5]) );
after->add:
Code:
ADDBYTE( pak, 0 );
nice to know that worked :)
hey guys im at work now but want to know if this code work
// -----------------------------------------------------------------------------------------
// GM: Anonymous Announcment
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakGMAnn( CWorldClient* thisclient, CPacket* P )
{
BEGINPACKET( pak, 0x702 );
ADDSTRING( pak, (&P->Buffer[5]) );
ADDBYTE( pak, 0 );
SendToAll( &pak );
return true;
}
it does with /ann
i dont know how to fix that m8 maybe you should try to start all over again.. atleast if you dont have any special things u created.
not really, because when u say something in the /ann it show your nickname:and later the messageit does with /ann
when i get home gonna test it :)
Ty for helping i fixed myself :) bud now he says unknown column 'monid' 'field list' plz help me : ) Fixed:)
EDIT: Ok i fixed that problem bud now when i start the world server my memory is geting higher and higher it starts with 230.240.250.300.320 :S and so on until my pc says that i use to much memory and then i shutted down the pc guz i couldnt do anything :S so plz can some1 help me Ty
-greets- Ni3tski
Last edited by Ni3tski; 18-11-06 at 10:42 AM.
Uuhm i got a qeustion about ig if i put exp rate at 10 it's only for 1 map
how do i change?