| | Emulator Server Discussion World of Warcraft Emulator Server general chat . [NO Questions here] |  | | 
02-09-2009
|  | Emulation Moderator Legendary User | | | Join Date: Feb 2007 Location: EST
Posts: 2,285
Nominated 3 Times in 1 Post Reputation: 975 Points: 25,812, Level: 23 | Level up: 19%, 1,388 Points needed |     | | | [C++] Function Library C++ Function Library Player Functions
SendAreaTriggerMessage("text"); - Sends an Area Trigger Message
BroadcastMessage("text"); - Sends a message to the chatbox
EventTeleport(mapid, x, y, z); - Teleports the player
SafeTeleport(mapid, instanceid, location vector); - Teleports the player to specific instance
Kick(miliseconds); - Kicks the player in x miliseconds
SoftDisconnect(); - Ends the player's session
Reset_Spells(); - Resets spells
Reset_Talents(); - Resets Talents
Reset_ToLevel1(); - Resets player to level 1
GiveXP(y, guid, true); - Gives y number of XP to a player guid
AddCalculatedRestXP(# of seconds); - Adds rested xp to player equal to # of seconds
GetPositionX(); - Get player's X coordinate
GetPositionY(); - Get player's Y coordinate
GetPositionZ(); - Get player's Z coordinate
GetPositionO(); - Get player's O coordinate
KillPlayer(); - Kills the player
ResurrectPlayer(); - Resurrects the player
SetBindPoint(x, y, z, mapid, zoneid); - Bind the player's hearthstone
ModStanding(Faction, Value); - Modifies the player's standing with the Faction
_AdvanceSkillLine(SkillLine, x); - Advances a skill line x times
_AddSkillLine(SkillLine, min, max); - Adds skill line x with minimum and maximum level
_RemoveSkillLine(x); - Removes skill line x
_HasSkillLine(x); - Returns true if player has skill line x
_RemoveAllSkills(); - Removes all skills from player
_RemoveLanguages(); - Removes all languages from player
_AddLanguages(true); - Adds all languages to player
_AdvanceAllSkills(x); - Advances all skills x times
_ModifySkillMaximum(SkillLine, Max); - Sets a skill level equal to Max
GetClass(); - Returns the player's class
GetRace(); Returns the player's race
getLevel(); - Returns the player's level
GetGUID(); - Returns the player's guid
GetLowGuid(); - Returns the player's low guid
getTeam(); Returns true (1) if player is horde GetItemInterface()->GetItemCount(itemid, false); - Returns the number of itemid the player has
PlaySoundToSet(entryid); - Plays a sound entry
Item * pItem = objmgr.CreateItem(itemid, Player);
GetItemInterface()->AddItemToFreeSlot(pItem); - Adds and item to Player
LevelInfo * Info = objmgr.GetLevelInfo(PlayerRace, PlayerClass, level);
ApplyLevelInfo(Info, level); - mods a players level PVP
IsPvPFlagged() - When returned true, player is in pvp
SetPvPFlag(); - Sets the player in pvp
RemovePvPFlag(); - Removes the player from pvp
IsFFAPvPFlagged() - When returned true, player is in FFA pvp
SetFFAPvPFlag(); - Sets the player in FFA pvp
RemoveFFAPvPFlag(); - Removes the player from FFA pvp
RecalculateHonor(); - Reloads honor Spells
AddAura(#); - Adds an aura to the player
addSpell(spellid); - Adds a spell to the player
CastSpell(target, spellid, 0); - Cast a spell on target
HasSpell(spellid); - Returns true if the player has the spell Quests
HasFinishedQuest(quest_id); - Returns true if player has finished the quest
HasQuestForItem(itemid); - Returns true if player has quest item
HasQuestSpell(spellid); - Returns true if player has quest spell
HasQuest(quest_id); - Returns true if player has quest
Last edited by Gastricpenguin; 02-09-2009 at 09:11 PM.
| Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
02-09-2009
|  | Emulation Moderator Legendary User | | | Join Date: Feb 2007 Location: EST
Posts: 2,285
Nominated 3 Times in 1 Post Reputation: 975 Points: 25,812, Level: 23 | Level up: 19%, 1,388 Points needed |     | | | Server Hooks Server Hooks OnNewCharacter(uint32 Race, uint32 Class, WorldSession * Session, const char * Name);
OnKillPlayer(Player * pPlayer, Player * pVictim);
OnFirstEnterWorld(Player * pPlayer);
OnEnterWorld(Player * pPlayer);
OnGuildCreate(Player * pLeader, Guild * pGuild);
OnGuildJoin(Player * pPlayer, Guild * pGuild);
OnDeath(Player * pPlayer);
OnRepop(Player * pPlayer);
OnEmote(Player * pPlayer, uint32 Emote, Unit * pUnit);
OnEnterCombat(Player * pPlayer, Unit * pTarget);
OnCastSpell(Player * pPlayer, SpellEntry * pSpell);
OnLogoutRequest(Player * pPlayer);
OnLogout(Player * pPlayer);
OnQuestAccept(Player * pPlayer, Quest * pQuest, Object * pQuestGiver);
OnZone(Player * pPlayer, uint32 Zone);
OnChat(Player * pPlayer, uint32 Type, uint32 Lang, const char * Message, const char * Misc);
OnLoot(Player * pPlayer, Unit * pTarget, uint32 Money, uint32 ItemId);
OnEnterWorld2(Player * pPlayer);
OnCharacterCreate(Player * pPlayer);
OnQuestCancelled(Player * pPlayer, Quest * pQuest);
OnQuestFinished(Player * pPlayer, Quest * pQuest, Object * pQuestGiver);
OnHonorableKill(Player * pPlayer, Player * pKilled);
OnArenaFinish(Player * pPlayer, ArenaTeam* pTeam, bool victory, bool rated);
OnObjectLoot(Player * pPlayer, Object * pTarget, uint32 Money, uint32 ItemId);
OnAreaTrigger(Player * pPlayer, uint32 areaTrigger);
OnPostLevelUp(Player * pPlayer);
OnPreUnitDie(Unit *Killer, Unit *Victim);
OnAdvanceSkillLine(Player * pPlayer, uint32 SkillLine, uint32 Current);
OnDealDamage(Player * plr); Hooking your script Code: void SetupSCRIPTNAME(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_NEW_CHARACTER, OnNewCharacterl);
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, OnKillPlayer);
mgr->register_hook(SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD, OnFirstEnterWorld);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_WORLD, OnEnterWorld);
mgr->register_hook(SERVER_HOOK_EVENT_ON_GUILD_JOIN, OnGuildJoin);
mgr->register_hook(SERVER_HOOK_EVENT_ON_DEATH, OnDeath);
mgr->register_hook(SERVER_HOOK_EVENT_ON_REPOP, OnRepop);
mgr->register_hook(SERVER_HOOK_EVENT_ON_EMOTE, OnEmote);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_COMBAT, OnEnterCombat);
mgr->register_hook(SERVER_HOOK_EVENT_ON_CAST_SPELL, OnCastSpell);
mgr->register_hook(SERVER_HOOK_EVENT_ON_TICK, OnTick);
mgr->register_hook(SERVER_HOOK_EVENT_ON_LOGOUT_REQUEST, OnLogoutRequest);
mgr->register_hook(SERVER_HOOK_EVENT_ON_LOGOUT, OnLogout);
mgr->register_hook(SERVER_HOOK_EVENT_ON_QUEST_ACCEPT, OnQuestAccept);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ZONE, OnZone);
mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, OnChat);
mgr->register_hook(SERVER_HOOK_EVENT_ON_LOOT, OnLoot);
mgr->register_hook(SERVER_HOOK_EVENT_ON_GUILD_CREATE, OnGuildCreate);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ENTER_WORLD_2, OnEnterWorld2);
mgr->register_hook(SERVER_HOOK_EVENT_ON_CHARACTER_CREATE, OnCharacterCreate);
mgr->register_hook(SERVER_HOOK_EVENT_ON_QUEST_CANCELLED, OnQuestCancelled);
mgr->register_hook(SERVER_HOOK_EVENT_ON_QUEST_FINISHED, OnQuestFinished);
mgr->register_hook(SERVER_HOOK_EVENT_ON_HONORABLE_KILL, OnHonorableKill);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ARENA_FINISH, OnArenaFinish);
mgr->register_hook(SERVER_HOOK_EVENT_ON_OBJECTLOOT, OnObjectLoot);
mgr->register_hook(SERVER_HOOK_EVENT_ON_AREATRIGGER, OnAreaTrigger);
mgr->register_hook(SERVER_HOOK_EVENT_ON_POST_LEVELUP, OnPostLevelUp);
mgr->register_hook(SERVER_HOOK_EVENT_ON_PRE_DIE, OnPreUnitDie);
mgr->register_hook(SERVER_HOOK_EVENT_ON_ADVANCE_SKILLLINE , OnAdvanceSkillLine);
mgr->register_hook(SERVER_HOOK_EVENT_ON_DEAL_DAMAGE, OnDealDamage);
}
Last edited by Gastricpenguin; 02-09-2009 at 08:20 PM.
| 
02-09-2009
|  | Contributor | | | Join Date: Aug 2008 Location: USA
Posts: 1,057
Reputation: 213 Level up: 49%, 411 Points needed |     | | Epic, just what I needed xD GP
__________________ To Write Love On Her Arms <3  | 
02-09-2009
|  | Web Developer Legendary User | | | Join Date: Jun 2007 Location: British Columbia
Posts: 2,279
Reputation: 636 Points: 18,780, Level: 18 | Level up: 66%, 520 Points needed |     | | Looks great, as always GP! | 
02-09-2009
| | Banned | | | Join Date: Dec 2007 Location: www.ArcEmu.org
Posts: 336
Reputation: 65 | | Be sure to use Visual Studio if you're on Windows that way Intellisense will give you a little popup/drop-down of how these functions are used and what their arguments are.
Also, if you need help using any of these (right click on the function and select Find References)
This little feature of Visual Studio finds all references of the function within the project | 
02-09-2009
|  | Contributor | | | Join Date: Jul 2006
Posts: 199
Reputation: 87 Level up: 27%, 517 Points needed |     | | | this is great Gastric, really useful for noobs | 
02-10-2009
|  | Contributor | | | Join Date: Nov 2007 Location: United Kingdom
Posts: 876
Reputation: 203 Level up: 49%, 571 Points needed |     | | Useful Gastric +rep if poss. | 
02-10-2009
|  | Contributor | | | Join Date: Nov 2007 Location: Snail land
Posts: 944
Reputation: 239 Level up: 50%, 450 Points needed |     | | | I was just thinking of making a C++ Wiki for emulaters =/, gj on this though | 
02-10-2009
|  | Is Bored | | | Join Date: Sep 2007 Location: England
Posts: 1,260
Nominated 38 Times in 2 Posts  TOTM/W Award(s): 1 Reputation: 545 Level up: 44%, 625 Points needed |     | | oh damn, i've been wanting this for ages... | 
02-10-2009
| | Corporal | | | Join Date: Sep 2008
Posts: 18
Reputation: 15 Level up: 63%, 148 Points needed | | | ive been wanting this also <3 | 
02-11-2009
|  | Contributor | | | Join Date: Jun 2007 Location: USA
Posts: 671
Reputation: 238 Level up: 86%, 154 Points needed |     | | Thanks, great for beginners! X3 | 
02-13-2009
|  | Elite User | | | Join Date: Jan 2008
Posts: 2,124
Reputation: 349 Level up: 46%, 600 Points needed |     | | | Note that functions which begin with an underscore are not supposed to be called outside of the class definition | 
02-22-2009
|  | Knight-Lieutenant | | | Join Date: Aug 2008 Location: Sweden
Posts: 358
Reputation: 68 Level up: 51%, 249 Points needed |    | | cool release! is any1 here good a VB programing? i would realy need a Function libary ^^ for release
__________________ Lines of Coding: |||||||||| Goal 1000
Current: 546 Achived Goals: 500 Lines  | 
03-29-2009
|  | Sergeant Major | | | Join Date: Mar 2009 Location: Ohio
Posts: 147
Reputation: 69 Level up: 83%, 88 Points needed |  | | Nice GP!
__________________ Need help with your PS (private server) well PM me and I'll do the best I can to help you out. ~-L0sT-~ | 
04-18-2009
| | New User | | | Join Date: Jan 2008
Posts: 53
Reputation: 1 | | | Awesome, thank you! +rep |  | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 07:09 AM. |