Skilled Illusionist
- Joined
- Mar 20, 2009
- Messages
- 374
- Reaction score
- 378
My KalOnline C++ Library
hey Folks,
today i wanna share my Library with all of you.
how to use it?
Download the .rar of the lib.
unpack it where you wanna store it. Visual studio open up your project
go to Project properties and link the include/Lib directory at "C++ directorys" to the Include/Lib folder you'
ve just downloaded
after that link the .lib file in your project by using:
#pragma comment(lib, "LunaLib.lib")
and include the header you wanna use for example:
#include <KPlayer.h>
#include <KServer.h>
example what you could do with thease:
wanna summon a monster?
Move to a player:
and there is alot more.
hey Folks,
today i wanna share my Library with all of you.
how to use it?
Download the .rar of the lib.
unpack it where you wanna store it. Visual studio open up your project
go to Project properties and link the include/Lib directory at "C++ directorys" to the Include/Lib folder you'
ve just downloaded
after that link the .lib file in your project by using:
#pragma comment(lib, "LunaLib.lib")
and include the header you wanna use for example:
#include <KPlayer.h>
#include <KServer.h>
example what you could do with thease:
Code:
void __fastcall LevelUp(int* Playerptr, int* edx){
UNREFERENCED_PARAMETER(edx);
auto_ptr<KServer> Server;
auto_ptr<KPlayer> Player(new KPlayer(Playerptr));
if (LevelEnabled){
Player->Levelup(LevelInc, LevelStatInc, LevelSkillInc);
}
else{ Player->Levelup(1, 5, 1); }
if (LevelNoticeEnabled && Player->GetLevel() >= LevelNoticeStartLevel){
if (!LevelNoticeType.compare("Lord_Red")){ Server->SetScreenInfo(ScreenInfoType::Red, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
else if (!LevelNoticeType.compare("Lord_Blue")){ Server->SetScreenInfo(ScreenInfoType::Blue, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
else if (!LevelNoticeType.compare("Lord_Orange")){ Server->SetScreenInfo(ScreenInfoType::Orange, Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
else if (!LevelNoticeType.compare("Notice")){ Server->Notice(RGB(LevelNoticeColorR, LevelNoticeColorG, LevelNoticeColorB), Server->string_to_char(Server->ParseString(Playerptr, LevelNoticeText))); }
}
if (LevelBuffEnabled){ Player->InsertBuff(LevelBuffID, LevelBuffTime, LevelBuffInc); }
}
wanna summon a monster?
Code:
[URL=https://forum.ragezone.com/usertag.php?do=list&action=hash&hash=include]#include[/URL] <KSummon.h>
auto_ptr<KSummon> Summon;
Summon->Monster(Index, X, Y, Map, Amount);
Move to a player:
Code:
if (command->beginWith("/moveto") && this->player->GetAdmin() >= ComMoveto){
this->SetForward(false);
int targetm = (0);
int targetx = (0);
int targety = (0);
string _TargetName = this->command->GetStrValue(1);
const char* TargetName = this->server->string_to_char(_TargetName);
if(TargetName){
int *TargetPointer = (int*)Server::CPlayer::FindPlayerbyName(TargetName);
auto_ptr<KPlayer> _target(new KPlayer(TargetPointer));
if(_target->isGood()){
targetm = (_target->GetMap());
targetx = (_target->GetX());
targety = (_target->GetY());
this->player->Teleport(false, targetm, targetx, targety);
this->player->InfoMessage(TextColor::GREEN_YELLOW, "Moved to %s", _target->GetName());
}
else{
this->player->InfoMessage(TextColor::RED, "The selected player is offline or doesn't exist.");
}
}
}
and there is alot more.
You must be registered to see links
You must be registered to see links
Last edited: