• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[CPP] Grumbo'z Guild Warz 'The Rise of the Guild'

slp13at420

Mad Scientist
there is a way to compare branches and view the differences. during the proccess of creating a .diff file. but i havnt made a diff in a while and forgot the process.

I recommend just focus on getting the scripts installed and running befor you do your personal touches to them.
 

Marko

Enthusiast
And the DB name in your sql server matches the name used in your worldserver.conf file?

Ofc man, maybe idk how to make C++ scripts but am not an idiot. and i even ran the items, gobj and npcs sql again. I dropped entire guild_warz_335 db and remade it again from sql from your github all is default. I'll redownload and use script one more time but i dont think anything will change since is the same script from 2 days ago. And am sure something inside C++ script is making that error. Maybe it fetches wrong row for currency or something.. idk.

i see u did some update to Guild Warz script just 11h ago so ill download it and see if it works out
 
Last edited:

Marko

Enthusiast
Script must be edited

And again, re-downloaded the script and deleted guild warz db, remade it from sql, ran all other sql's too.. Cmake and then recompiled..
Again crash:
Grumbo'z Guild Warz CPP -
- -
- For Trinity Core WotlK 3.3.5a -
______________________________________
- LOADING -
- commands loaded -
- help system loaded -
- 710 locations loaded
- Error Loading Currency ID:0 . Item May NOT exsist in the sql DB.
- Make sure you are using a valid item entry id in the sql DB.
- Prepare for crash.

aaaaand i fixed it.. how? well i created item entry 0 Guild Coin.. but i think this will make a lot of troubles now in game. It should not work like this.. Your script should not need item entry 0, but 62006

another issue is that your faction leaders do not give the quest that allows for buying lands and building
 
Last edited:

slp13at420

Mad Scientist
And again, re-downloaded the script and deleted guild warz db, remade it from sql, ran all other sql's too.. Cmake and then recompiled..
Again crash:


aaaaand i fixed it.. how? well i created item entry 0 Guild Coin.. but i think this will make a lot of troubles now in game. It should not work like this.. Your script should not need item entry 0, but 62006

dont worry i dont think your being stupid in any sense of the statement.
as you can see in your screenshot it is loading data from the DB (710 locations).
but when it gets to reading from column (15) `currency` of entry 'SERVER' it consistently reads '0'...

it will work fine using entry '0' as an alternate itemID for use as currency but it should still read by default '62006' since i did design it to support flexibility to change :)

dont worry, my first attempt at adding a CPP script took a nightmarish amount of time before i got it to work , at all lol.

I will continue to try and figure out why that one entry i fighting us so much ...

- - - Updated - - -

when you get ingame try and change some of the Admin settings `InGame`. i.e. '/g set anarchy 1'
then examine `guild_warz_335.commands` and check "SERVER" entry 'anarchy' and see if it changes from 0 to 1 and back to 0.

'/g set anarchy 1'
'/g set anarchy 0'

will activate/deactivate the Anarchy System but also change a variable in the "SERVER" entry of the `commands` table.
 

slp13at420

Mad Scientist
if it cant find `guild_warz_335.commands` table then it would crash @ the query during loading.

so it even is reading the data since it states `commands loaded` there is a check to not post anything if it loaded 0 command entries.(That would cause issue to due to it wouldnt have a base set of game commands for the guilds to use then.)

when your ingame type '/g commands' and screenshot it for us .
 

slp13at420

Mad Scientist
I did catch one inconsistency in the sql table. `currency` was defined as a medium int but in the script it says it should read a Big Int(uint64) so i updated the sql table to BigInt()
that may possibly be your issue there. dunno y it worked fine for me when it should go askew reading a uint32 as a uint64 lol.
 

Marko

Enthusiast
Wrath of the Error Build!

well now i have another small problem.. Since i edited my core for 255 stats it was all messed up, even though i followed this guide
http://emudevs.com/showthread.php/2619-TC-255-server-stats-edit!?
all the items had no dmg and no stats and all creatures had just 1hp which means something got messed up in calculations. i tried to fix this by editing all the edited values back into Float but no use it was still all broken. So i again took fresh un-edited eluna trinity and compiled it with ur scripts and got errors on compile:
Severity Code Description Project File Line Suppression State
Error LNK2005 "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl ConvertNumberToString(unsigned __int64)" (?ConvertNumberToString@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_K@Z) already defined in scripts.lib(Grumboz_VIP_Core.obj) worldserver C:\Users\Admin\Desktop\ElunaTrinityWotlk\build\src\server\worldserver\scripts.lib(Grumboz_Guild_Warz.obj) 1
and
Code:
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1169	one or more multiply defined symbols found	worldserver	C:\Users\Admin\Desktop\ElunaTrinityWotlk\build\bin\Release\worldserver.exe	1
even though they have been put properly like this:
// This is where scripts' loading functions should be declared:
void AddSC_Grumboz_VIP_Core();
void AddSC_Grumboz_Guild_Warz();

// The name of this function should match:
// void Add${NameOfDirectory}Scripts()

void AddCustomScripts()
{
AddSC_Grumboz_VIP_Core();
AddSC_Grumboz_Guild_Warz();
}
 
Last edited:

slp13at420

Mad Scientist
ok i updated the rev 62 2-13-2017 branch this weekend when i had some down time and wrapped everything into a class GGW so no cross contamination should occur anymore ;)
 

Marko

Enthusiast
My internet was not working since Friday. :herpderp:
And now i downloaded ur latest VIP and Guild versions and recompiled fine (but without these VIP edits mentioned below).
Now i noticed i missed the edits for mod hp, armor and all that i did not even see the Extras folder before, maybe that is why ur VIP script was always modding player HP to 1. :coffee:
Now will do all edits there. Am a little unsure am i supposed to replace (for example) in void Player::UpdateArmor() this
UnitMods unitMod = UNIT_MOD_ARMOR;

float value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items)
value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items
value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats
value += GetModifierValue(unitMod, TOTAL_VALUE);
with this
float VIP_OFFSET = sVIP->GetVIPOFFSET();
uint32 acctId = GetSession()->GetAccountId();
uint8 Pvip = sVIP->GetPlayerVIP(acctId);
float MOD = (Pvip * VIP_OFFSET);
or simply add it there? in your instructions you did not mention this, what exacly needs to be done, just add that or replace it all with it.

Now am worried if i make all these edits the wrong way for example replace instead of add, that recompile will not work :conflicted:
 

slp13at420

Mad Scientist
yea just add these lines at the start of the function:
Code:
[COLOR="#808080"]
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);
[/COLOR]

end product looks like this:
Code:
[COLOR="#808080"]
void Player::UpdateArmor()
{
[COLOR="#DAA520"]	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);[/COLOR]
	
	UnitMods unitMod = UNIT_MOD_ARMOR;

    float value = GetModifierValue(unitMod, BASE_VALUE);    // base armor (from items)
    value *= GetModifierValue(unitMod, BASE_PCT);           // armor percent from items
    value += GetStat(STAT_AGILITY) * 2.0f;                  // armor bonus from stats
    value += GetModifierValue(unitMod, TOTAL_VALUE);

    //add dynamic flat mods
    AuraEffectList const& mResbyIntellect = GetAuraEffectsByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
    for (AuraEffectList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i)
    {
        if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
            value += CalculatePct(GetStat(Stats((*i)->GetMiscValueB())), (*i)->GetAmount());
    }

    value *= GetModifierValue(unitMod, TOTAL_PCT);

[COLOR="#DAA520"]	uint32 THP = (uint32)value * MOD;
	int32 HPMOD = (int32)value + THP;

	SetArmor(int32(HPMOD));
	//    SetArmor(int32(value));[/COLOR]

    Pet* pet = GetPet();
    if (pet)
        pet->UpdateArmor();

    UpdateAttackPowerAndDamage();                           // armor dependent auras update for SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
}
[/COLOR]
 

Marko

Enthusiast
lol yea i just noticed i didnt jot down the best notes to do those edits i will update those xD

but still things like this are not exacly clear like:
add inside the if statement `if (pItem)` at start . around line 11141
uint32 acctId = GetSession()->GetAccountId();
uint8 Pvip = sVIP->GetPlayerVIP(acctId);
uint8 Ivip = sVIP->GetItemVIP(pItem->GetEntry());

if (Pvip < Ivip)
{
ChatHandler(GetSession()).PSendSysMessage("|cffFF0000You Must be VIP%u or higher to equip this item.|r", Ivip);
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
}
well here is that part of player.cpp
Item* pItem = Item::CreateItem(item, 1, this);
if (pItem)
{
InventoryResult result = CanEquipItem(slot, dest, pItem, swap);
delete pItem;
return result;
}

Should your code be added here above "if (pItem)" or inside the {} like this? (which makes no sense)
Item* pItem = Item::CreateItem(item, 1, this);
if (pItem)
{uint32 acctId = GetSession()->GetAccountId();
uint8 Pvip = sVIP->GetPlayerVIP(acctId);
uint8 Ivip = sVIP->GetItemVIP(pItem->GetEntry());

if (Pvip < Ivip)
{
ChatHandler(GetSession()).PSendSysMessage("|cffFF0000You Must be VIP%u or higher to equip this item.|r", Ivip);
return EQUIP_ERR_CANT_DO_RIGHT_NOW;
}
InventoryResult result = CanEquipItem(slot, dest, pItem, swap);
delete pItem;
return result;
}
or perhaps it should be added below all that, or perhaps this entire part of code should be deleted
{
InventoryResult result = CanEquipItem(slot, dest, pItem, swap);
delete pItem;
return result;
}
and replaced with your code ? but this is not mentioned in instruction. still confused as there are even many more ways it can be misunderstood and done incorrectly.

I believe it is best simply to give example of before and after finish product, that way no confusion
 
Top