Aller au contenu

Photo

module onacquire party loot


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
XbiT

XbiT
  • Members
  • 23 messages

Hello all,

 

I was testing out this bit of script today and don't see what the issue is. It fires the floating text above the head of the player that acquires items but it doesn't fire anything a party member can see. I'm not a scripter by any means so be gentle.

// 2/12/15-MBURNEY SOA Custom Module On Acquire 2/12/15


#include "hcr2_core_i"

void main() {

	// Auto-Generated by Legends Master Configurator 1.92
	ExecuteScript("leg_all_mastermod_itemacquired", OBJECT_SELF);
	
{
   	h2_RunModuleEventScripts(H2_EVENT_ON_ACQUIRE_ITEM);
}

	object item = GetModuleItemAcquired();
	object acquirer = GetModuleItemAcquiredBy();
	object oPartyMember = GetFirstFactionMember(acquirer, TRUE);
	string textToSpeak;
	if(GetBaseItemType(item) == 255)
		textToSpeak = GetName(acquirer) + " picked up some gold"; //Gold.  Apparently the defined global value for BASE_ITEM_GOLD being 76 is a lie, it's 255.
	else if(GetItemStackSize(item)>1)
		textToSpeak = GetName(acquirer) + " picked up " + IntToString(GetItemStackSize(item)) + " " + GetName(item) + "s";
	else
		textToSpeak = GetName(acquirer) + " picked up a " + GetName(item);
		
		
	while (GetIsObjectValid(oPartyMember) == TRUE) {
		if(oPartyMember == acquirer)
			FloatingTextStringOnCreature(textToSpeak,acquirer,FALSE,5.0);
		else if (GetArea(oPartyMember) != GetArea(acquirer))
			SendMessageToPC(oPartyMember, textToSpeak);
		oPartyMember = GetNextFactionMember(acquirer, TRUE);
	}
}


#2
kevL

kevL
  • Members
  • 4 061 messages

in FloatingTextStringOnCreature()

 

try changing FALSE ( bBroadcastToFaction ) to TRUE and see what happens


  • GCoyote aime ceci

#3
XbiT

XbiT
  • Members
  • 23 messages

That was it..

 

if(oPartyMember == acquirer)

 

is what was confusing to me. I was thinking it was trying to say if the acquirer was a party member and if so to not float the text since it already had on the pc..

 

Thanks!



#4
kevL

kevL
  • Members
  • 4 061 messages

welcome :)